diff --git a/synclounge.subfolder.conf.sample b/synclounge.subfolder.conf.sample index bc433ae..4912da3 100644 --- a/synclounge.subfolder.conf.sample +++ b/synclounge.subfolder.conf.sample @@ -1,6 +1,12 @@ -#******** Due to some bugs in SyncLounge, this config may conflict with others. ********* +# 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 -# Set `webroot` to `slweb` and restart the container +### +# 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; @@ -13,17 +19,28 @@ location /slweb { proxy_pass $upstream_proto://$upstream_app:$upstream_port; } - -# Due to a bug in SyncLounge, some requests like /config don't respect the web's base url setting (webroot) -# TODO: Update when fixed -location /config { - return 301 $scheme://$host/slweb$request_uri; +if ($http_referer ~* /slweb) { + rewrite ^/config /slweb/config redirect; + rewrite ^/socket.io/(.*) /slserver/socket.io/$1? redirect; } -# Invite links need to be rewritten to use the web's base url setting (webroot) -# The docker container currently sets `autoJoinUrl` ENV variable on build to `http://${DOMAIN}` -# overriding what the user has set. -# TODO: Update when fixed -location /invite/ { - return 301 $scheme://$host/slweb$request_uri; -} \ No newline at end of file +### +# 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; +}