From c839811b9f82ae458699e096c441840151bf97cd Mon Sep 17 00:00:00 2001 From: Martin Berg Alstad Date: Tue, 10 Jun 2025 16:41:02 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[pi4]=20Fix=20wrong=20nginx=20co?= =?UTF-8?q?nfig=20for=20headscale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hosts/pi4/nginx.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/hosts/pi4/nginx.nix b/hosts/pi4/nginx.nix index 68205f0..721e325 100644 --- a/hosts/pi4/nginx.nix +++ b/hosts/pi4/nginx.nix @@ -51,7 +51,20 @@ in # Headscale "vpn.${domain}" = proxyLocations { "/web".proxyPass = "${homelab}:8084"; - "/".proxyPass = "${homelab}:8082"; + "/" = { + proxyPass = "${homelab}:8082"; + extraConfig = '' + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_redirect http:// https://; + proxy_buffering off; + 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 $scheme; + add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always; + ''; + }; }; # Headscale SmartDNS "dns.${domain}" = homelabProxy 8082;