502 Bad Gateway

5xx Server Error. A server acting as a gateway or proxy received an invalid response from the upstream server it was trying to reach.

5xx Server Error

What it means

A server acting as a gateway or proxy received an invalid response from the upstream server it was trying to reach.

Common causes

A backend server crashed, is overloaded, restarted, or a proxy/load-balancer configuration issue between it and the client.

How to fix it

Retry the request after a short wait. If you run the server, check the backend's logs and health, and the proxy/load-balancer configuration.

Frequently asked questions

What does HTTP 502 mean?

A server acting as a gateway or proxy received an invalid response from the upstream server it was trying to reach.

What causes a 502 Bad Gateway?

A backend server crashed, is overloaded, restarted, or a proxy/load-balancer configuration issue between it and the client.

How do I fix a 502 error?

Retry the request after a short wait. If you run the server, check the backend's logs and health, and the proxy/load-balancer configuration.

Other 5xx Server Error codes