421 Misdirected Request
The request reached a server that cannot produce a response for the requested authority, usually a connection reuse problem under HTTP/2.
At a glance
- Status code
- 421 Misdirected Request
- Class
- 4xx, client error, the request itself is the problem
- Defined in
- RFC 9110
- Cacheable by default
- no
- Response body
- Optional.
In detail
HTTP/2 lets a client reuse one connection for several hostnames covered by the same certificate. If the server behind that connection is not configured for one of them, it answers 421.
The client is expected to retry on a fresh connection, which usually succeeds, so 421 is often invisible.
On a shared certificate covering multiple domains, check that every domain in the certificate is actually configured on every server that can terminate it.
Examples
HTTP/1.1 421 Misdirected Request
Content-Length: 0Things that catch people out
- The failure is intermittent by nature: it depends on which connection the client happened to reuse.
- A wildcard certificate on a shared load balancer is the classic trigger, because it invites coalescing across hosts that are configured differently.
Try it: HTTP Request Builder
Build a request with any method, headers and body, send it, and read the status line the server returns.
HTTP Request Builder
LOCAL · Browser-OnlyBuild and test HTTP requests with custom headers and body
Authentication
Headers
Generate Code
curl -X GET 'https://api.example.com/endpoint' \
-H 'Content-Type: application/json'Showing a sample URL. Enter your endpoint above to update the snippet.
Related HTTP status codes
All http status codes →400 Bad Request
The server refused the request because it was malformed. The client must change something before retrying, because repeating the same bytes will fail.
502 Bad Gateway
A proxy or load balancer got an invalid response from the upstream server it was relaying to. The failure is behind the thing that answered you.
404 Not Found
The server has no representation for this URL and will not say whether it ever did. The most common status code on the web after 200.
422 Unprocessable Content
The request was well-formed and understood, but the values inside it failed validation. The syntax was fine and the semantics were not.
423 Locked
The resource is locked by WebDAV and cannot be modified until the lock is released or a valid lock token is supplied.
424 Failed Dependency
The request failed because an earlier request it depended on failed, so this one was never attempted.
Tools for this
- HTTP Request Builder Free online HTTP request builder - build and test HTTP requests with custom headers and body
- HTTP Headers Checker Free online HTTP headers checker - view HTTP response headers for any URL