server { listen 80; server_name localhost; # Security headers add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; # Gzip compression gzip on; gzip_vary on; gzip_min_length 10240; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/javascript; gzip_disable "MSIE [1-6]\."; root /usr/share/nginx/html; index index.html; # Cache static assets location /assets { expires 1y; add_header Cache-Control "public, no-transform"; } # Handle SPA routing location / { try_files $uri $uri/ /index.html; expires -1; add_header Cache-Control "no-store, no-cache, must-revalidate"; } }