HTTP 421 Misdirected Request vs 521 Web Server Is Down
HTTP 421 (Misdirected Request) is a 4xx Client Error response, while 521 (Web Server Is Down) 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, 521 means that cloudflare-specific. The origin server refused the connection.
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 refused the connection.
When You See It
When Cloudflare can't establish a TCP connection to the origin server.
How to Fix
Check that the origin server is running and the firewall allows Cloudflare IPs.
Key Differences
421 is a 4xx Client Error response, while 521 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 521: Cloudflare-specific. The origin server refused the connection.
You encounter 421 when with HTTP/2 when a connection is reused for a domain the certificate doesn't cover.
You encounter 521 when when Cloudflare can't establish a TCP connection to the origin server.
When to Use Which
For 421 (Misdirected Request): Retry the request on a new connection. For 521 (Web Server Is Down): Check that the origin server is running and the firewall allows Cloudflare IPs.