From 1e7427ec0df8aaa5267412ee2a7bf9229ecb39ed Mon Sep 17 00:00:00 2001 From: rope Date: Wed, 27 May 2026 09:21:55 +0100 Subject: [PATCH] nginx: add no-store cache header to code-server vhost Prevents browser from restoring cached page with expired Authelia session, which caused WebSocket 1006 on first load. Co-Authored-By: Claude Opus 4.6 --- services/nginx.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/services/nginx.nix b/services/nginx.nix index bca7871..7311b96 100644 --- a/services/nginx.nix +++ b/services/nginx.nix @@ -114,7 +114,14 @@ in "adguard.nordhammer.it" = protectedProxy 3000; "profilarr.nordhammer.it" = protectedProxy 6868; "sabnzbd.nordhammer.it" = protectedProxy 8085; - "code.nordhammer.it" = protectedProxy 4444; + "code.nordhammer.it" = lib.recursiveUpdate (protectedProxy 4444) { + locations."/".extraConfig = autheliaAuthConfig + '' + # Prevent browser from restoring a cached page on tab reopen — + # forces a fresh request so Authelia can redirect before JS + # tries to open a WebSocket with an expired session. + add_header Cache-Control "no-store" always; + ''; + }; "notes.nordhammer.it" = protectedProxy 5230; # --- Local-only: serves update history JSON to Homepage's customapi widget ---