HTTP 421 Misdirected Request

The request reached a server that is not able to answer for the host it asked about, typically because an HTTP/2 connection was reused for the wrong origin.

Defined in RFC 9110 §15.5.20 — 421 Misdirected Request · MDN reference

Where you meet HTTP 421 in production

HTTP/2 and HTTP/3 connection coalescing: a browser reuses one connection for two hostnames covered by the same certificate, but the server behind it only serves one of them.

Why you would test it

Shows up only with connection reuse across hostnames that share a certificate and IP. The test is whether your client retries on a new connection, as it should.

What your client should do about a 421

Retry the request on a fresh connection to the host. Browsers do this automatically; custom clients and proxies sometimes need to be told.

421 versus the codes it gets confused with

Endpoints that return 421

1 endpoint in this playground answers with 421. Every one is free, needs no signup, and can be called from the browser or with curl.

Questions about HTTP 421

Why is 421 related to HTTP/2?
HTTP/2 lets clients reuse a connection for several hostnames; 421 is how a server says "not on this connection".
Is it safe to retry a 421?
Yes, on a new connection — the server did not process the request.

Other client error codes

All HTTP status codes · All 39 mock REST APIs · Getting started guide

Last updated