2025-06-16 22:43:46 +00:00
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
server_name _;
|
2026-02-08 20:06:33 +00:00
|
|
|
server_tokens off;
|
2025-06-16 22:43:46 +00:00
|
|
|
|
|
|
|
|
# Root directory for static files (must match Docker COPY path)
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
|
index index.html;
|
|
|
|
|
|
2026-02-08 22:51:11 +00:00
|
|
|
# index.html must never be cached so new asset hashes are picked up
|
|
|
|
|
location = /index.html {
|
|
|
|
|
add_header Cache-Control "no-cache";
|
|
|
|
|
try_files $uri /index.html;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Hashed assets are immutable — cache indefinitely
|
|
|
|
|
location /assets/ {
|
|
|
|
|
expires 1y;
|
|
|
|
|
add_header Cache-Control "public, immutable";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# SPA fallback
|
2025-06-16 22:43:46 +00:00
|
|
|
location / {
|
|
|
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable gzip compression
|
|
|
|
|
gzip on;
|
|
|
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
|
|
|
}
|