Bad Gateway 502

Reference guide

Request path

  1. You (reached)
  2. DNS (reached)
  3. Cloudflare edge (reached)
  4. Origin (answered with a warning)

502

Likely cause

The origin returned an invalid response to whatever is in front of it — Cloudflare, or the origin's own reverse proxy/load balancer.

What to do

  1. Check. Check the origin's own reverse proxy/load balancer logs (e.g. nginx, HAProxy) for the upstream connection that failed, and check whether the actual application server process is running.
  2. Fix. Restart or fix the failing upstream application server/process, or correct the proxy's upstream configuration if it's pointing at the wrong address.
  3. Verify. Retry the request and confirm it now reaches the application successfully.

Back to error lookup