server { listen 80; server_name localhost; # Root directory for static files root /usr/share/nginx/html; index index.html index.htm; # Serve static files directly location / { try_files $uri $uri/ /index.html; } # Optional: Add headers for caching, security, etc. # Example: Cache assets aggressively location ~* \.(?:css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires 1y; add_header Cache-Control "public"; } }