diff --git a/README.md b/README.md index 80c4a20..749fb62 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/defaults/main.yml b/defaults/main.yml index c17e075..8946e01 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/templates/http/default.conf.j2 b/templates/http/default.conf.j2 index f5922cd..2e5dded 100644 --- a/templates/http/default.conf.j2 +++ b/templates/http/default.conf.j2 @@ -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 }};