server_tokens off; charset utf-8; server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # Security headers add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always; add_header X-XSS-Protection "1; mode=block" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always; # Cache static assets (CSS/JS/images/fonts) location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|mp4|webm)$ { expires 30d; add_header Cache-Control "public, immutable"; } # Multi-page (not SPA): try exact file, then .html fallback (friendly URLs), then 404. # NEVER fallback to index.html — that masks 404s for a multi-entry design shelf. location / { try_files $uri $uri/ $uri.html =404; } }