Skip to content

Commit 4a04306

Browse files
authored
Merge pull request #7 from linuxserver/websocket-proxying
WebSocket proxying
2 parents 055801b + c679461 commit 4a04306

File tree

4 files changed

+41
-6
lines changed

4 files changed

+41
-6
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,18 @@ This will *ask* Google et al not to index and list your site. Be careful with th
231231
* You can check the status of a specific jail via `docker exec -it swag fail2ban-client status <jail name>`
232232
* You can unban an IP via `docker exec -it swag fail2ban-client set <jail name> unbanip <IP>`
233233
* A list of commands can be found here: https://www.fail2ban.org/wiki/index.php/Commands
234+
### Updating configs
235+
* This container creates a number of configs for nginx, proxy samples, etc.
236+
* Config updates are noted in the changelog but not automatically applied to your files.
237+
* If you have modified a file with noted changes in the changelog:
238+
1. Keep your existing configs as is (not broken, don't fix)
239+
2. Review our repository commits and apply the new changes yourself
240+
3. Delete the modified config file with listed updates, restart the container, reapply your changes
241+
* If you have NOT modified a file with noted changes in the changelog:
242+
1. Delete the config file with listed updates, restart the container, reapply your changes
243+
* Proxy sample updates are not listed in the changelog. See the changes here: [https://github.com/linuxserver/reverse-proxy-confs/commits/master](https://github.com/linuxserver/reverse-proxy-confs/commits/master)
244+
* Proxy sample files WILL be updated, however your renamed (enabled) proxy files will not.
245+
* You can check the new sample and adjust your active config as needed.
234246

235247

236248
## Docker Mods
@@ -303,4 +315,5 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
303315

304316
## Versions
305317

318+
* **01.09.20:** - Update nginx.conf and proxy.conf (and various proxy samples) to better handle websockets.
306319
* **03.08.20:** - Initial release.

readme-vars.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ app_setup_block: |
8484
> * Edit the compose yaml to change the image to `linuxserver/swag` and change the service and container names to `swag`
8585
> * Issue `docker-compose up -d --remove-orphans`
8686
> * If you don't want to or can't use the option `--remove-orphans`, then you can first do `docker-compose down`, then edit the compose yaml as above, and then issue `docker-compose up -d`
87-
87+
8888
> Make sure to also update any references to this container by name. For instance, Nextcloud's `config.php` references this container in its `trusted_proxies` directive, which would have to be updated to `swag`.
8989
### Validation and initial setup
9090
* Before running this container, make sure that the url and subdomains are properly forwarded to this container's host, and that port 443 (and/or 80) is not being used by another service on the host (NAS gui, another webserver, etc.).
@@ -130,10 +130,23 @@ app_setup_block: |
130130
* You can check the status of a specific jail via `docker exec -it swag fail2ban-client status <jail name>`
131131
* You can unban an IP via `docker exec -it swag fail2ban-client set <jail name> unbanip <IP>`
132132
* A list of commands can be found here: https://www.fail2ban.org/wiki/index.php/Commands
133+
### Updating configs
134+
* This container creates a number of configs for nginx, proxy samples, etc.
135+
* Config updates are noted in the changelog but not automatically applied to your files.
136+
* If you have modified a file with noted changes in the changelog:
137+
1. Keep your existing configs as is (not broken, don't fix)
138+
2. Review our repository commits and apply the new changes yourself
139+
3. Delete the modified config file with listed updates, restart the container, reapply your changes
140+
* If you have NOT modified a file with noted changes in the changelog:
141+
1. Delete the config file with listed updates, restart the container, reapply your changes
142+
* Proxy sample updates are not listed in the changelog. See the changes here: [https://github.com/linuxserver/reverse-proxy-confs/commits/master](https://github.com/linuxserver/reverse-proxy-confs/commits/master)
143+
* Proxy sample files WILL be updated, however your renamed (enabled) proxy files will not.
144+
* You can check the new sample and adjust your active config as needed.
133145
134146
app_setup_nginx_reverse_proxy_snippet: false
135147
app_setup_nginx_reverse_proxy_block: ""
136148

137149
# changelog
138150
changelogs:
139-
- { date: "03.08.20:", desc: "Initial release." }
151+
- { date: "01.09.20:", desc: "Update nginx.conf and proxy.conf (and various proxy samples) to better handle websockets." }
152+
- { date: "03.08.20:", desc: "Initial release." }

root/defaults/nginx.conf

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Version 2019/12/19 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx.conf
1+
## Version 2020/09/01 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx.conf
22

33
user abc;
44
worker_processes 4;
@@ -23,7 +23,7 @@ http {
2323
types_hash_max_size 2048;
2424
variables_hash_max_size 2048;
2525
large_client_header_buffers 4 16k;
26-
26+
2727
# server_tokens off;
2828

2929
# server_names_hash_bucket_size 64;
@@ -72,6 +72,14 @@ http {
7272
#passenger_root /usr;
7373
#passenger_ruby /usr/bin/ruby;
7474

75+
##
76+
# WebSocket proxying
77+
##
78+
map $http_upgrade $connection_upgrade {
79+
default upgrade;
80+
'' close;
81+
}
82+
7583
##
7684
# Virtual Host Configs
7785
##

root/defaults/proxy.conf

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Version 2019/10/23 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/proxy.conf
1+
## Version 2020/09/01 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/proxy.conf
22

33
client_body_buffer_size 128k;
44

@@ -23,7 +23,8 @@ proxy_set_header X-Forwarded-Host $host;
2323
proxy_set_header X-Forwarded-Ssl on;
2424
proxy_redirect http:// $scheme://;
2525
proxy_http_version 1.1;
26-
proxy_set_header Connection "";
26+
proxy_set_header Upgrade $http_upgrade;
27+
proxy_set_header Connection $connection_upgrade;
2728
#proxy_cookie_path / "/; HTTPOnly; Secure"; # enable at your own risk, may break certain apps
2829
proxy_cache_bypass $cookie_session;
2930
proxy_no_cache $cookie_session;

0 commit comments

Comments
 (0)