4xx Client Errors
HTTP 421 Misdirected Request
The request was directed at a server that cannot produce a response.
When is 421 used?
- HTTP/2 server confusion
- CDN routing to wrong origin
How to handle a 421 response
Inspect the request — URL, method, headers, credentials, and body. Retrying the same request unchanged will usually fail again; 429 is the exception, where you should wait for the Retry-After period.
Check the status code a URL returns from the command line:
curl -s -o /dev/null -w "%{http_code}\n" https://example.comHow to return 421 from your server
Node.js (Express)
res.status(421).json({ message: 'Misdirected Request' });Python (Flask)
return {"message": "Misdirected Request"}, 421Go (net/http)
w.WriteHeader(421)Frequently Asked Questions
What does HTTP 421 mean?
421 Misdirected Request: The request was directed at a server that cannot produce a response.
Is 421 an error?
Yes. 421 is in the 4xx Client Errors class. Client errors: the request is malformed, unauthorized, or targets something that does not exist.