server { listen 80; server_name localhost; root /usr/share/nginx/html; index index.html; add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self';"; # Caching configuration for static assets location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { expires 30d; add_header Cache-Control "public, no-transform"; } # Always serve index.html for any request location / { try_files $uri $uri/ /index.html; } # Error handling error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }