Skip to content
Free tool

502 Bad Gateway

A proxy or load balancer in front of the site got an invalid answer (or none) from the application behind it.

Why it happens

  • The application process crashed or is restarting.
  • The app server (PHP-FPM, Gunicorn, Node) isn't running or is out of workers.
  • A deploy where the new process isn't up yet.
  • A misconfigured upstream address in nginx or Caddy.

What to do

  • Check that the application process is running and listening on the port the proxy expects. Look at both the proxy's and the app's logs.

In monitoring

Counts as down. If two checks in a row see it, you're alerted with this code as the cause.

Catch the next 502 before a customer does.

heyUptime checks your site every 30 seconds, confirms a failure before alerting, and tells you the code and the likely reason.

Start watching free

All status codes · Not sure what your site returns right now? Check it.

Next time, be the first to know.

Let someone else watch the shop. If anything breaks, you will hear it from us, not from a customer.

Start your 14-day free trial No credit card needed