From 38aba4ea1de3bc308e127f709c9398e552b7abb3 Mon Sep 17 00:00:00 2001 From: gmhta <59901080+gmhta@users.noreply.github.com> Date: Mon, 24 Aug 2020 23:29:13 +1000 Subject: [PATCH] websocket & wildcard redirect (#25) --- config/nginx.conf.tpl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config/nginx.conf.tpl b/config/nginx.conf.tpl index e27307b..76e7abc 100644 --- a/config/nginx.conf.tpl +++ b/config/nginx.conf.tpl @@ -9,6 +9,11 @@ worker_connections 1024; } http { + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + include /etc/nginx/mime.types; default_type application/octet-stream; @@ -53,6 +58,9 @@ http { proxy_pass http://localhost:{{port}}; proxy_send_timeout 300; proxy_read_timeout 300; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; } } {{/port}} @@ -74,7 +82,7 @@ http { alias {{letsencryptWwwDir}}/.well-known/acme-challenge; } location / { - return 301 https://$server_name$request_uri; + return 301 https://$host$request_uri; } } server { @@ -89,6 +97,9 @@ http { proxy_pass http://localhost:{{port}}; proxy_send_timeout 300; proxy_read_timeout 300; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; } } {{/port}}