nginx: Cache-Header fuer Root-Statik (Logo etc.), assets mit ^~ abgesichert
Build & Deploy / deploy (push) Successful in 24s

This commit is contained in:
2026-10-07 19:19:40 +02:00
parent 9bd60b4634
commit 1a2201e380
2 changed files with 11 additions and 2 deletions
+10 -2
View File
@@ -19,12 +19,20 @@ server {
add_header Cache-Control "no-cache" always;
}
# Cache für gehashte Build-Assets
location /assets/ {
# Cache für gehashte Build-Assets (^~ = Prefix schlägt Regex-Locations,
# sonst würde die Bild-Regel unten das immutable-Caching überschreiben)
location ^~ /assets/ {
expires 30d;
add_header Cache-Control "public, immutable";
}
# Statische Dateien im Root (Logo, Favicons – nicht hash-benannt,
# daher nur kurz cachen, sonst riskiert der Browser veraltete Dateien)
location ~* \.(png|jpg|jpeg|webp|ico|svg|woff2?)$ {
expires 1d;
add_header Cache-Control "public";
}
# Mail-API des Portals (Container mp-mail-api im selben Docker-Netz npm_default).
# Das Token kommt aus portal.env (envsubst beim Container-Start) und liegt
# NIE im Repo und NIE im Browser – der Endpunkt ist nur vom Server erreichbar.