DELAPARRA
Index
Color
NL
Category: HTTP status codes

502 Bad Gateway

Explained by Updated

What is 502 Bad Gateway?

502 Bad Gateway: The server was acting as a gateway and received an invalid response from upstream. 502 Bad Gateway means a server that sits in front of your application, such as a load balancer, reverse proxy or CDN, received an invalid response from the application behind it. In practice it usually means the application process crashed, was restarting, or is not listening where the proxy expects. During a deploy you may see a short burst of 502s while old processes stop and new ones start.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about 502 Bad Gateway

What should you keep in mind with 502 Bad Gateway?

To debug it, look one step further back. The proxy's own logs tell you which upstream failed, and the application or container logs tell you why. Common causes are a crashed PHP-FPM or Node process, a container that fails its start command, or a wrong port in the proxy configuration. Zero-downtime deploys and health checks prevent most of the deploy-time 502s.

At a glance

CategoryHTTP status codes
Explained by
Updated

More HTTP status codes terms

All terms starting with a number or symbol

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.