One thing I am learning as I continue my DevOps journey is that deploying an application successfully is only part of the job. Understanding what happens when that application fails is equally important.
In this hands-on lab, I deliberately broke my Node.js backend on an AWS EC2 Ubuntu server to see how NGINX behaves. The result was the classic 502 Bad Gateway .
I documented the full lab with screenshots on my blog:
Full tutorial here β https://blog.sirvickcloud9.online/2026/10/how-i-fixed-nginx-502-bad-gateway-error.html
What I Used
AWS EC2 Ubuntu 22.04
Node.js backend on port 3000
NGINX 1.24.0 as reverse proxy (port 80 β 127.0.0.1:3000)
Request flow: Browser β NGINX β Node.js
What Happened
I stopped the Node.js service and hit my public IP. NGINX was still up but returned 502. That was the key lesson: 502 does not mean NGINX is down.β¦