Add websockets configuration back to http template (#140)

* Add websockets config back to template

* Implement #111 Changes for proxy_http_version and made it configurable.

* Moved out of the websockets block and make it independently configurable
This commit is contained in:
Philip Henning 2019-07-12 19:59:25 +02:00 committed by Alessandro Fael Garcia
parent c730f522f1
commit 43fdafe1b1
3 changed files with 9 additions and 0 deletions

View File

@ -493,6 +493,7 @@ nginx_http_template:
proxy_ignore_headers:
- Vary
- Cache-Control
proxy_http_version: 1.0
websocket: false
auth_basic: null
auth_basic_user_file: null

View File

@ -305,6 +305,7 @@ nginx_http_template:
proxy_ignore_headers:
- Vary
- Cache-Control
proxy_http_version: 1.0
websocket: false
auth_basic: null
auth_basic_user_file: null

View File

@ -161,6 +161,13 @@ server {
{% for header in item.value.reverse_proxy.locations[location].proxy_set_header %}
proxy_set_header {{ item.value.reverse_proxy.locations[location].proxy_set_header[header].name }} {{ item.value.reverse_proxy.locations[location].proxy_set_header[header].value }};
{% endfor %}
{% if item.value.reverse_proxy.locations[location].proxy_http_version is defined %}
proxy_http_version {{ item.value.reverse_proxy.locations[location].proxy_http_version }};
{% endif %}
{% 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 %}
{% endif %}
{% if item.value.reverse_proxy.locations[location].try_files is defined %}
try_files {{ item.value.reverse_proxy.locations[location].try_files }};