What is HTTP 502 Bad Gateway?
HTTP 502 Bad Gateway is a server-side error indicating that a proxy, edge server, or load balancer received an invalid response from the upstream origin server. In scraping pipelines, this rarely means the target site is completely down. Instead, it usually signals that your proxy node was blocked by the target's firewall, the target's rate-limiting dropped the connection abruptly, or the upstream server crashed while processing a heavy query. Misinterpreting a 502 as a generic retryable error leads to infinite loops and burned proxy IPs.