Shop25 pages + lab
Nginx Break-Fix Field Guide
502 Bad Gateway. 504 Gateway Time-out. 413 Request Entity Too Large. This tells you which side broke, what to run next, and what to change.
Every error.log line, curl result and timing came from a real nginx 1.27.5, broken on purpose.

What's inside
- 9 flowcharts: 502, 504 and why it took longer than your timeout, 413 on upload, the SPA that 404s on refresh, redirect loops behind HTTPS, WebSockets that never upgrade, the wrong site answering, 403 on files that exist, the proxy_pass trailing slash
- An error.log decoder: every line from the lab, what it means, where to go
- Two tested templates: a reverse proxy and a single-page app
- The lab: every config and script, plus the raw output
Found in the lab
- A stopped backend gave 504 after 60 seconds, not a quick 502
- nginx kept sending traffic to a dead container's old IP
- A 3 s timeout with two upstreams made the user wait 6.02 s
- 1,048,576 bytes uploaded fine. 1,048,577 got 413
- The usual SPA fix served index.html for a missing JS file
Tested on
nginx 1.27.5, Node 22, curl 8.7.1, Docker Engine 29.9.2
For
Devs who put nginx in front of their app, juniors who inherited a server, anyone staring at a 502 with no idea which side broke.
Read first, free
- Five kinds of 502. The error log names each one.
I broke nginx five ways until I had five different 502s. Each leaves its own line in error.log. The stale IP one looked like a refused port while the app was fine.
Other guides
$39 · 4 guidesAll four, one download
Free · 8 pages + labPlay Store Release: Signed Right
$15 · 14 pages + labApple Release: Signed, Notarized, Shipped
$12 · 25 pages + kind labKubernetes Break-Fix Field Guide
$12 · 25 pages + labDocker Break-Fix Field Guide
$24 · 14 pages + labIngress NGINX to Gateway API runbook
Free · samplerKubernetes Break-Fix: free sampler