What is HTTP 502 Bad Gateway?
The 502 Bad Gateway status code occurs when a proxy or gateway cannot communicate correctly with an upstream service.
It is commonly seen in environments using reverse proxies, load balancers, and distributed applications.
Common Causes
- Backend service failures
- Application crashes
- Incorrect proxy configuration
- Network connectivity issues
- DNS problems
Common DevOps Scenarios
- Nginx proxy errors
- Load balancer failures
- Container crashes
- Unavailable upstream services
Troubleshooting
Engineers should check both the gateway and the upstream application logs.
Summary
The 502 Bad Gateway response indicates communication failure between servers.