5xx Server error

HTTP 502 Bad Gateway

A server working as a gateway or proxy got an invalid response from the server behind it (the upstream). The proxy is up; the application behind it isn’t answering properly.

Defined in RFC 9110, section 15.6.3(opens in a new tab)

Full guide 502 Bad Gateway: What It Means and How to Fix It

Is 502 up or down for a monitor?

Uptimecheck HTTP monitor

Default settings

Down

Down. It is outside the default 200–399 range, so a monitor reports an outage once a second check confirms it. If 502 is the answer you expect from that URL, add it to the monitor’s expected status codes.

Is it down? checker

Free, at /is-it-down/

Down

Down. A 5xx means the server, or something in front of it, failed to answer.

Why you see 502 and what to do

Typical causes

  • The application server (PHP-FPM, Node.js, Gunicorn) has crashed, is restarting during a deploy, or isn’t running.
  • The proxy points at the wrong address or port.
  • The upstream closes the connection early, or sends headers too large for the proxy’s buffers.

If you run the site

  • Check that the application process is running, then read the proxy’s error log for the upstream error.
  • Restart workers one at a time during deploys, so something always answers.

If you’re a visitor

  • Reload in a minute or two; the site is having trouble behind the scenes.

Know the moment your site stops answering as it should

An Uptimecheck monitor requests your page as often as every minute, checks the status code against the ones you expect, confirms a failure with a second check and then alerts you.

14-day free trial · No credit card required

Questions

What does HTTP 502 mean?

A server working as a gateway or proxy got an invalid response from the server behind it (the upstream). The proxy is up; the application behind it isn’t answering properly.

Does an uptime monitor count 502 as down?

Down. It is outside the default 200–399 range, so a monitor reports an outage once a second check confirms it. If 502 is the answer you expect from that URL, add it to the monitor’s expected status codes.

Downtime is obsolete.

Set up your first monitor in under a minute, or look around the live demo first.

14-day free trial · No credit card required