server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # Flat HTML — serve /locations/buffalo as /locations/buffalo.html location / { try_files $uri $uri/ $uri.html =404; } # Cache static assets location ~* \.(jpg|jpeg|png|webp|svg|ico|css|js|woff2?|mp4|webm)$ { expires 30d; add_header Cache-Control "public, immutable"; access_log off; } # Security headers add_header X-Frame-Options "SAMEORIGIN"; add_header X-Content-Type-Options "nosniff"; add_header Referrer-Policy "strict-origin-when-cross-origin"; # Gzip gzip on; gzip_types text/html text/css application/javascript image/svg+xml; gzip_min_length 1024; error_page 404 /index.html; }