HTTP 502 Bad Gateway
502 Bad Gateway means a server acting as a gateway or proxy received an invalid response from an upstream server it was trying to reach. It points at a problem between layers — origin down, app crash, or a misconfigured proxy — rather than at the requested resource itself.
What 502 means
502 Bad Gateway is returned by a server acting as a gateway or proxy when it receives an invalid response from the upstream server it contacted to fulfil the request. The edge is up, but what is behind it failed to answer properly.
Common causes are an origin that is down or crashing, an application that returned a malformed response, or a proxy misconfiguration.
Transient vs persistent 502s
A short burst of 502s during a deploy or restart is usually transient — crawlers retry and recover. The concern is persistent 502s: they indicate a real break between your edge and origin, and like sustained 500s they cause crawlers to slow down and can risk pages being treated as unavailable.
Diagnosis means looking below the edge: is the origin healthy, is the app responding, are timeouts or bad upstream addresses involved?
- Edge/proxy is up; upstream gave an invalid response
- Transient 502s during deploys are usually recoverable
- Persistent 502s degrade crawl health like sustained 500s
Operator checklist
When crawlers see 502s, check origin health and application logs, not just the edge. Verify upstream addresses, timeouts, and proxy configuration. For planned restarts, prefer returning 503 with Retry-After at the edge over letting requests fail with 502.
How it appears in analytics and logs
A 502 means a proxy or gateway could not get a valid response from upstream. For crawlers it is a failed fetch; transient 502s are tolerated, but persistent 502s indicate an origin or proxy problem that can degrade crawl health like sustained 500s.
Diagnostic use case
Diagnose 502s a crawler receives, and tell a transient blip from a persistent upstream fault that needs fixing before it affects crawling.
What WebmasterID can help detect
WebmasterID can surface 502s crawlers receive and the affected paths, helping you tell a brief upstream blip from a persistent gateway fault.
Common mistakes
- Looking only at the edge and missing an unhealthy origin behind it.
- Treating persistent 502s as harmless transient blips.
- Letting deploys throw 502s instead of serving 503 with Retry-After.
Privacy and accuracy notes
Status codes carry no personal data. WebmasterID reports 502 patterns for crawler traffic without exposing individual visitors.
Related pages
- HTTP 500 and crawl health
500 Internal Server Error is a generic message that something went wrong on the server and it could not complete the request. Occasional 500s happen, but repeated 500s on important URLs harm crawl health: crawlers may slow down and, if errors persist, treat affected pages as unreliable.
- HTTP 503 Service Unavailable for maintenance
503 Service Unavailable means the server is temporarily unable to handle the request, usually due to maintenance or overload. It is the correct, index-protecting status for planned downtime: with a Retry-After header, compliant crawlers understand the outage is temporary and come back later.
- Website observability
See gateway errors crawlers receive and the affected paths.
Sources and verification notes
Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.