reverse-proxy-confs/synclounge.subfolder.conf.sample
2020-03-18 12:02:20 -04:00

47 lines
1.5 KiB
Plaintext

# Use this if you are using the `latest` or `alpine` tags for the container, which contains both the web client and server applications.
# Make sure that you have set the web base url (webroot/WEB_ROOT setting) to '/slweb' or change all occurrences of `/slweb` below to match your settings.
# The server base url (serverroot/SERVER_ROOT) defaults to '/slserver'. If you change this setting, change all occurrences of '/slserver' below
###
# Client
###
# Due to a bug in SyncLounge, some requests like /config don't respect the base url (web root) setting
location /slweb {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_app synclounge;
set $upstream_port 8088;
set $upstream_proto http;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
if ($http_referer ~* /slweb) {
rewrite ^/config /slweb/config redirect;
rewrite ^/socket.io/(.*) /slserver/socket.io/$1? redirect;
}
###
# Server
###
# Proxy for the server
location /slserver {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_app synclounge;
set $upstream_port 8089;
set $upstream_proto http;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
if ($http_referer ~* /slserver) {
rewrite ^/socket.io/(.*) /slserver/socket.io/$1? redirect;
}