server { listen 80; root /usr/share/nginx/html; index index.html; location / { try_files $uri $uri.html $uri/ =404; } location /_next/static/ { expires 1y; add_header Cache-Control "public, immutable"; } location /images/ { expires 30d; add_header Cache-Control "public"; } error_page 404 /404.html; }