Skip to content
5xx · Server Error

502 Bad Gateway

A server acting as a gateway received an invalid response from the upstream server.

What it means

HTTP 502 Bad Gateway means a server acting as a proxy or gateway received an invalid or empty response from the upstream server it was trying to reach. The edge server is fine; the backend it depends on returned something broken.

When it happens

It happens when an origin server is down or crashing behind a CDN or load balancer, when an upstream times out, or when a reverse proxy cannot get a valid response from the application server.

How to fix it

  • Check that the origin or upstream application server is running and healthy.
  • Review reverse proxy or load balancer configuration and upstream addresses.
  • Inspect upstream logs for crashes or timeouts.
  • Restart the application server if it has hung.

SEO impact

Damaging if sustained. Like other 5xx errors, 502 prevents indexing and signals unreliability to crawlers. Resolve quickly to avoid crawl-rate reductions and ranking loss.

Check it with Sitewell

Find out which of your URLs return 502

Paste a list of URLs and Sitewell checks the status code of every one at once — free and without signup.

Related codes

Related guides