From 83001d2ec1b5c2ca8bdcb6c92c337f70eae9ef2a Mon Sep 17 00:00:00 2001 From: Travis Shivers Date: Fri, 4 Sep 2020 21:22:43 -0500 Subject: [PATCH] docs(nginx): add documentation for running at subfolder --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b6c9b440..c4ac0ff2 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,7 @@ If you want to change any of the [default configuration](https://github.com/ttsh ### Sample Nginx config If you want to run SyncLounge behind Nginx, here is an example configuration +#### Subdomain sub.domain.com ``` map $http_upgrade $connection_upgrade { default upgrade; @@ -140,11 +141,14 @@ server { listen [::]:80; listen 443 ssl http2; listen [::]:443 ssl http2; - server_name YOURSERVERNAMEHERE; - # include your ssl certs and parms, etc + # TODO: Replace this with your domain + server_name somesubdomain.yourserver.com; + + # TODO: include your ssl certs and parms, etc location / { + # TODO: Replace this with your container address or localhost proxy_pass http://containeraddress:8088; proxy_http_version 1.1; proxy_socket_keepalive on; @@ -165,6 +169,50 @@ server { } ``` +#### Subfolder domain.com/somefolder/ +To make synclounge run at a subfolder, all you need to do is change your reverse proxy configuration. +``` +map $http_upgrade $connection_upgrade { + default upgrade; + '' ''; +} + + +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + + # TODO: Replace this with your domain + server_name somesubdomain.yourserver.com; + + # TODO: include your ssl certs and parms, etc + + # TODO: replace "somefolder" with your desired subfolder + location /somefolder/ { + # TODO: Replace this with your container address or localhost. + # Important: keep the trailing slash + proxy_pass http://containeraddress:8088/; + proxy_http_version 1.1; + proxy_socket_keepalive on; + proxy_redirect off; + + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Host $server_name; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions; + proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key; + proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version; + } +} +``` + ### Older Help The FAQ, Self-Hosting, Development, Contributing, and other documentation has been move to [docs.synclounge.tv](http://docs.synclounge.tv)! Head there for more information!