Files
playground-frontend/nginx.conf
Andreas Dahm a26443af8f
Some checks failed
Build, Test & Push Frontend / quality-check (pull_request) Failing after 41s
Build, Test & Push Frontend / docker (pull_request) Has been skipped
Lots of technical improvements
2026-06-02 15:48:31 +02:00

62 lines
1.7 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
# index.html: never cache
location = /index.html {
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
add_header Pragma "no-cache";
add_header Expires "0";
try_files $uri =404;
}
# Service worker control files must never be cached hard, otherwise the
# PWA can no longer pick up new deployments. Exact matches win over the
# generic *.js rule below.
location = /ngsw-worker.js {
add_header Cache-Control "no-cache, max-age=0, must-revalidate";
try_files $uri =404;
}
location = /ngsw.json {
add_header Cache-Control "no-cache, max-age=0, must-revalidate";
try_files $uri =404;
}
location = /safety-worker.js {
add_header Cache-Control "no-cache, max-age=0, must-revalidate";
try_files $uri =404;
}
location = /worker-basic.min.js {
add_header Cache-Control "no-cache, max-age=0, must-revalidate";
try_files $uri =404;
}
location = /manifest.webmanifest {
add_header Cache-Control "no-cache, max-age=0, must-revalidate";
try_files $uri =404;
}
# Angular Bundles cache hard
location ~* \.(?:js|css)$ {
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
# Assets (Bilder, JSON, Fonts, etc.): just revalidate
location ^~ /assets/ {
add_header Cache-Control "no-cache, max-age=0, must-revalidate";
try_files $uri =404;
}
# Also no cache for other html site
location ~* \.html$ {
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
add_header Pragma "no-cache";
add_header Expires "0";
try_files $uri =404;
}
location / {
try_files $uri $uri/ /index.html;
}
}