server { listen 5173; server_name _; root /usr/share/nginx/html; index index.html; gzip on; gzip_types text/plain text/css application/json application/javascript image/svg+xml; gzip_min_length 1024; # Immutable fingerprinted assets location /assets/ { expires 30d; add_header Cache-Control "public, immutable"; } # The service worker must never be cached, or the PWA can never update location = /sw.js { add_header Cache-Control "no-cache, no-store, must-revalidate"; } # SPA fallback — React Router owns the paths location / { try_files $uri $uri/ /index.html; } }