From abde419f06a4947d50082c018505fbbcf0bb66e4 Mon Sep 17 00:00:00 2001 From: DIERCKXK Date: Wed, 8 Dec 2021 13:52:26 +0100 Subject: [PATCH] Provide default map for a connection_upgrade variable based on the http_upgrade field --- templates/nginx.conf.tmpl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/templates/nginx.conf.tmpl b/templates/nginx.conf.tmpl index 3085323..deb2985 100644 --- a/templates/nginx.conf.tmpl +++ b/templates/nginx.conf.tmpl @@ -131,5 +131,14 @@ http { ~^/(?.*)$ $no_slash; } + # http://nginx.org/en/docs/http/websocket.html + # top-level http config for websocket headers + # If Upgrade is defined, Connection = upgrade + # If Upgrade is empty, Connection = close + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + include {{ getenv "NGINX_CONF_INCLUDE" "conf.d/*.conf" }}; }