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;