server { listen 8080; root /usr/share/nginx/html; index index.html; # SPA fallback — all routes served by index.html location / { try_files $uri $uri/ /index.html; } # Cache static assets location ~* \.(js|css|png|jpg|ico|woff2?)$ { expires 1y; add_header Cache-Control "public, immutable"; } gzip on; gzip_types text/plain text/css application/javascript application/json; }