# SPA serving: static assets with long-lived caching, everything else # falls back to index.html (client-side routing). server { listen 8080; server_name _; root /usr/share/nginx/html; index index.html; gzip on; gzip_types text/css application/javascript application/json image/svg+xml; gzip_min_length 1024; location /healthz { add_header Content-Type text/plain; return 200 'ok'; } location /assets/ { # Vite emits content-hashed filenames — safe to cache forever. add_header Cache-Control "public, max-age=31536000, immutable"; try_files $uri =404; } location / { add_header Cache-Control "no-cache"; try_files $uri /index.html; } }