Thinking of nginx as the server in front of your server is right for most production layouts: terminate TLS here, decide what is cached versus passed through, and keep app processes off the public ports. I keep static and cacheable responses at the edge when I can, and I only proxy dynamic paths with Host, X-Forwarded-For, and X-Forwarded-Proto set so the app sees the public scheme and hostname.
Ops checks that catch most outages: reload instead of restart after config changes, watch error_log for connect() failed versus upstream timed out, and size worker_connections for both client and upstream sockets. After a change I hit a cached asset and a dynamic path separately — a mis-scoped proxy_pass or missing trailing-slash rule often looks like an app bug when it is still an edge config issue.
Edge Ops
Thinking of nginx as the server in front of your server is right for most production layouts: terminate TLS here, decide what is cached versus passed through, and keep app processes off the public ports. I keep static and cacheable responses at the edge when I can, and I only proxy dynamic paths with Host, X-Forwarded-For, and X-Forwarded-Proto set so the app sees the public scheme and hostname.
Ops checks that catch most outages: reload instead of restart after config changes, watch error_log for connect() failed versus upstream timed out, and size worker_connections for both client and upstream sockets. After a change I hit a cached asset and a dynamic path separately — a mis-scoped proxy_pass or missing trailing-slash rule often looks like an app bug when it is still an edge config issue.