From 4cdc8e11e4a7da1299047077a7cbfe2aa37a73cf Mon Sep 17 00:00:00 2001 From: symetryczny <36606184+symetryczny@users.noreply.github.com> Date: Tue, 5 Oct 2021 12:39:40 +0200 Subject: [PATCH] Websockets As per https://gotify.net/docs/nginx --- gotify.subdomain.conf.sample | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gotify.subdomain.conf.sample b/gotify.subdomain.conf.sample index d86e0d1..0efdde6 100644 --- a/gotify.subdomain.conf.sample +++ b/gotify.subdomain.conf.sample @@ -18,6 +18,23 @@ server { #include /config/nginx/authelia-server.conf; location / { + + # Ensuring it can use websockets + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto http; + proxy_redirect http:// $scheme://; + + # The proxy must preserve the host because gotify verifies the host with the origin for WebSocket connections + proxy_set_header Host $http_host; + + # These sets the timeout so that the websocket can stay alive + proxy_connect_timeout 1m; + proxy_send_timeout 1m; + proxy_read_timeout 1m; + # enable the next two lines for http auth #auth_basic "Restricted"; #auth_basic_user_file /config/nginx/.htpasswd;