421

Misdirected Request

4xx Client Error

ELI5

You sent your request to the wrong server. It's like calling the wrong phone number - the person who answered can't help you.

Server perspective

Use 421 when the request reached a server that cannot produce a response for that scheme-and-authority combination.

When to use

  • Return 421 for connection coalescing, SNI, or virtual-host mismatches
  • Use it when the failure is about the connection being routed to the wrong server rather than the resource being missing
  • HTTP/2 connection coalescing issues
  • Server cannot handle specific Host header
  • SNI (Server Name Indication) mismatches
  • Load balancer routing errors
  • Virtual host configuration issues

How to respond

  • Keep 421 tied to connection-target mismatch, not generic routing errors
  • Do not let caches treat it like a resource-level property

Headers to consider

  • No status-specific header is required; connection authority, TLS/SNI, and routing context are the important signals.

Response body

  • A body is optional; include a short explanation only if it will not expose routing details.

Server-side pitfalls

  • Do not misuse 421 as a substitute for 404 or 400
  • Do not cache a 421 as though it describes the resource itself
  • Resource doesn't exist (use 404 Not Found)
  • Bad request format (use 400 Bad Request)
  • Authentication required (use 401 Unauthorized)

Examples

HTTP/2 connection coalescing mismatch

Request:GET https://api.example.test/data # Headers Host: cdn.example.com
Response:421 Misdirected Request # Headers Content-Type: application/json # Body { "error": "misdirected_request" }

Server handling cdn.example.com cannot serve api.example.com requests

Virtual host mismatch

Request:GET https://api.example.test/api/users # Headers Host: wrong.example.com
Response:421 Misdirected Request # Headers Content-Type: application/json # Body { "error": "misdirected_request" }

Server received request for domain it doesn't serve

References

Related Status Codes