HTTP 421 Misdirected Request vs 520 Web Server Returned an Unknown Error
HTTP 421 (Misdirected Request) is a 4xx Client Error response, while 520 (Web Server Returned an Unknown Error) is a 5xx Server Error response. 421 indicates that the request was directed at a server that is unable to produce a response for the combination of scheme and authority in the URI. In contrast, 520 means that cloudflare-specific. The origin server returned an unexpected response that Cloudflare could not process.
Description
The request was directed at a server that is unable to produce a response for the combination of scheme and authority in the URI.
When You See It
With HTTP/2 when a connection is reused for a domain the certificate doesn't cover.
How to Fix
Retry the request on a new connection.
Description
Cloudflare-specific. The origin server returned an unexpected response that Cloudflare could not process.
When You See It
When Cloudflare receives an empty, unknown, or malformed response from the origin.
How to Fix
Check origin server logs. Ensure responses include proper headers. Verify SSL configuration.
Key Differences
421 is a 4xx Client Error response, while 520 is a 5xx Server Error response.
HTTP 421: The request was directed at a server that is unable to produce a response for the combination of scheme and authority in the URI.
HTTP 520: Cloudflare-specific. The origin server returned an unexpected response that Cloudflare could not process.
You encounter 421 when with HTTP/2 when a connection is reused for a domain the certificate doesn't cover.
You encounter 520 when when Cloudflare receives an empty, unknown, or malformed response from the origin.
When to Use Which
For 421 (Misdirected Request): Retry the request on a new connection. For 520 (Web Server Returned an Unknown Error): Check origin server logs. Ensure responses include proper headers. Verify SSL configuration.