From b0d65d4a17f5840e7088869ca221ce1aad7ac5bf Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 23 Apr 2018 17:48:57 +0200 Subject: [PATCH] nginx-virthost: Fix a problem with the websockets configuration. --- nginx/templates/nginx-virthost.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nginx/templates/nginx-virthost.j2 b/nginx/templates/nginx-virthost.j2 index 48ff98b5..5c3b0c77 100644 --- a/nginx/templates/nginx-virthost.j2 +++ b/nginx/templates/nginx-virthost.j2 @@ -194,10 +194,6 @@ server { {% endfor %} {% endif %} - {% if item.websockets is defined and item.websockets %} - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - {% endif %} {% if item.proxy_standard_setup is defined and item.proxy_standard_setup %} # Proxy stuff {% if item.include_global_proxy_conf is defined and not item.include_global_proxy_conf %} @@ -222,6 +218,10 @@ server { {% if location.target is defined %} proxy_pass {{ location.target }}; {% endif %} + {% if location.websockets is defined and location.websockets %} + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + {% endif %} {% if location.extra_conf is defined %} {{ location.extra_conf }} {% endif %}