proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=static_cache:10m max_size=1g inactive=60m use_temp_path=off; # From nextjs example nginx config server { listen 80; server_name localhost; # Proxy /api to backend location /api/ { proxy_pass http://localhost:8000/; } # Cache static assets location /_next/ { proxy_ignore_headers "Cache-Control" "Vary"; proxy_cache static_cache; proxy_cache_key $uri; proxy_cache_valid any 48h; proxy_pass http://localhost:3000; } location / { proxy_pass http://localhost:3000/; } }