server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # Gzip compression gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml image/svg+xml; gzip_min_length 1024; # Main page location / { try_files $uri $uri/ /index.html; } # Web app manifest location = /site.webmanifest { default_type application/manifest+json; expires 30d; add_header Cache-Control "public, immutable"; } # Assets - long cache for images location /assets/ { expires 30d; add_header Cache-Control "public, immutable"; try_files $uri =404; } # Security headers add_header X-Frame-Options SAMEORIGIN always; add_header X-Content-Type-Options nosniff always; }