HTTP/4xx (Client Error)
421 Misdirected Request
The request was directed at a server that is not able to produce a response for this scheme and authority.
❓ Why does this happen?
HTTP/2 connection coalescing reused a TLS connection for a hostname the server's certificate or vhost does not serve.
✅ How to fix it
Ensure each hostname has a matching TLS certificate and server block, or disable HTTP/2 coalescing for mismatched hosts.
Return or handle 421 in your stack
// app/api/resource/route.ts
export function GET() {
return Response.json(
{ error: "Misdirected Request", status: 421 },
{
status: 421
}
);
}Live 421 mock endpoint
Point your app, tests, or retry logic at this free public URL to reproduce a real 421 response (CORS enabled, optional ?delay=ms up to 5000).
https://castov.com/api/mock/421Frequently Asked Questions
What does HTTP Status 421 mean?
Why am I getting a 421 status code?
How do I fix a 421 Misdirected Request error?
How can I test how my app handles a 421 response?
Other 4xx status codes
Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.