Websocket support enabled for reverse proxy locations. (#97)

* Websocket support for reverse proxy locations.
This commit is contained in:
carlba 2019-02-08 14:32:32 +01:00 committed by Grzegorz Dzien
parent 3a66e10a17
commit 8db44bf979
3 changed files with 6 additions and 0 deletions

View File

@ -350,6 +350,7 @@ nginx_http_template:
backend:
location: /
proxy_pass: http://backend
websocket: false
health_check_plus: false
upstreams:
upstream1:

View File

@ -181,6 +181,7 @@ nginx_http_template:
backend:
location: /
proxy_pass: http://backend
websocket: false
health_check_plus: false
upstreams:
upstream1:

View File

@ -41,6 +41,10 @@ server {
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;
{% if item.value.reverse_proxy.locations[location].websocket is defined and item.value.reverse_proxy.locations[location].websocket %}
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
{% endif %}
}
{% endfor %}