server { listen 80; server_name localhost; # Serve static frontend files location / { root /usr/share/nginx/html; index index.html; try_files $uri $uri/ =404; } # Serve uploaded files location /uploads/ { alias /uploads/; autoindex off; # Cache uploaded images for 1 day expires 1d; add_header Cache-Control "public, immutable"; } # 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; }