The HTTP status code 502 Bad Gateway means a server acting as a gateway or proxy received an invalid response from an upstream server (RFC 9110). The proxy itself works, the server behind it returned something it could not use.
At a glance
- Status code
- 502
- Class
- 5xx (server error)
- Duration
- not specified
- In Google
- same as 500: crawl rate drops, URLs are removed if the error persists
- Specification
- RFC 9110, section 15.6.3
Last checked:
Where does a 502 come from?
Reverse proxies, load balancers and CDNs sit between the visitor and the application server. If the application crashes, restarts or answers with broken data, the proxy reports 502. MDN calls it a catch-all for server errors that points to the place in the request chain where the failure occurred. Practice guides commonly name overloaded backends, wrong upstream addresses or ports in the proxy configuration and DNS problems between proxy and backend.
MDN also notes that client-side network problems such as VPNs, firewalls or DNS settings can produce the error.
502, 503 and 504
The table below compares the three codes with 500 and 429 and shows how Google reacts to each.
| Status code | Meaning per RFC | How Googlebot reacts | Effect on the index | Retry-After |
|---|---|---|---|---|
| 429 Too Many Requests | too many requests in a given amount of time (rate limiting, RFC 6585) | treated as a sign of an overloaded server and as a server error; crawling temporarily slows down | indexed URLs are kept for now; if Googlebot sees the code on the same URL for multiple days, it may be dropped | RFC: may be included; Google: tells crawlers when they can retry |
| 500 Internal Server Error | unexpected condition on the server | the site's crawl rate drops in proportion to the number of URLs returning a server error | indexed URLs are kept for now; persistent errors get them removed, possibly after multiple days on the same URL | Google only describes it for 503 and 429 |
| 502 Bad Gateway (this term) | a gateway or proxy got an invalid response from the server behind it | same as 500 | indexed URLs are kept for now and removed if the error persists | Google only describes it for 503 and 429 |
| 503 Service Unavailable | temporarily unavailable, for example due to overload or maintenance | same as 500 | indexed URLs are kept for now; if Googlebot sees the code on the same URL for multiple days, it may be dropped | RFC: may be included and states the expected downtime; Google: tells crawlers when they can retry (seconds or a date) |
| 504 Gateway Timeout | a gateway or proxy didn't get a timely response from the server behind it | not listed individually by Google; for all 5xx codes, crawling temporarily slows down | indexed URLs are kept for now but eventually dropped (statement for all 5xx) | Google only describes it for 503 and 429 |
Google ignores any content it receives with a 5xx response. Once the server responds with 2xx again, Google gradually increases the crawl rate. To deliberately reduce crawling for a short time (a few hours up to 1-2 days), Google names 500, 503 or 429 and advises against doing so for longer. Google treats network timeouts, connection resets and DNS errors similarly to 5xx errors; according to Google, unreachable URLs are removed from the index within days. Sources: Google Crawling Infrastructure: How HTTP status codes affect Google's crawlers (last updated 2026-02-04); Google Crawling Infrastructure: Reduce the Google crawl rate (last updated 2026-10-06); Google Crawling Infrastructure: Debug network and DNS errors (last updated 2025-12-18); RFC 9110: HTTP Semantics, 15.6 Server Error 5xx and 10.2.3 Retry-After; RFC 6585: Additional HTTP Status Codes, 4. 429 Too Many Requests. Last checked: .
What does a 502 mean for SEO?
Google counts 5xx errors as server errors and names 502 explicitly. They make Google’s crawlers slow down temporarily, and Google lowers the crawl rate for the site. Already indexed URLs stay in the index at first, but URLs that persistently return a server error are eventually removed. Google gives no time frame. Once the server answers with 2xx again, Google gradually raises the crawl rate.
A short 502 during a deployment usually has little effect. Repeated 502s on important URLs deserve attention in server logs and in the crawl stats report in Search Console.
Example
HTTP/1.1 502 Bad Gateway
Content-Type: text/html
<h1>Bad Gateway</h1>
Common mistakes
- Persistent 502 responses on important URLs. Google removes URLs that persistently return a server error from the index. Server logs show whether the error was short-lived.
- Proxy error page served with status 200. If a page shows an error message but returns 200, Search Console reports a soft 404 error when the content suggests an error, according to Google.
FAQ
Is a 502 error my fault? As a visitor, usually not. The error comes from the servers behind the site. Your own network can play a role only through VPNs, firewalls or DNS settings.
Will a 502 fix itself? It often disappears once the upstream server is back, for example after a restart. If it persists, the server logs of the proxy and the application show where the response broke.
Sources
- RFC 9110: HTTP Semantics, 15.6.3 502 Bad Gateway – IETFrfc-editor.org
- 502 Bad Gateway – MDN Web Docsdeveloper.mozilla.org
- How HTTP status codes affect Google's crawlers – Google Crawling Infrastructuredevelopers.google.com
Last updated: