What HTTP 421 Means
HTTP 421, often labeled “Misdirected Request,” indicates that the server (or an intermediary acting on behalf of the origin) believes the incoming request was routed to the wrong place. In other words, the request did not reach the expected destination context, so the server declines to process it as-is.
This code is most relevant in environments where requests pass through layers such as reverse proxies, load balancers, or gateways, and where routing decisions depend on connection state, headers (like the requested authority/host), or previously established paths.
How 421 Works in Practice
A misdirected request usually arises when the network path or connection-level association does not match the request’s intended target. Common triggers include:
- Stale or mismatched routing context: A proxy or gateway may reuse information from an earlier request on the same connection.
- Host/authority or path mismatch: The request’s target (host/authority, URL path) does not align with what the intermediary expects for that connection.
- HTTP protocol and connection behavior: In setups that reuse connections across multiple requests (and possibly multiple origins), incorrect correlation can occur.
When the intermediary detects that the request cannot be safely treated as belonging to the expected destination context, it can respond with 421 rather than forwarding it blindly.
Differences and Limits: When 421 Matters (and When It Doesn’t)
421 is not a “content” error (like “resource not found”). Instead, it is a routing/dispatch signal. That distinction affects how you interpret it:
- If you see 421, focus on where the request is going, not on application logic.
- If you see other 4xx/5xx codes (e.g., 404, 403, 500), those may reflect authorization, missing routes, or server-side failures, not misdirection.
What 421 does not guarantee
Because the exact cause depends on the proxy/gateway implementation and the surrounding network topology, you should avoid assuming a single universal root cause. In particular, 421 does not by itself prove which specific component detected the mismatch.
Retry limitations
A 421 response is generally treated as a hint that retrying may help, but retrying the same request without changing any routing-affecting details might simply reproduce the same mismatch. The safer approach is to ensure the retry is made with the correct target information and without reusing any problematic routing context.
Practical Checks You Can Perform
You can often narrow down misdirection quickly by checking the inputs that determine routing:
-
Verify the request target
- Confirm the URL, especially host/authority and path, are exactly what you intend.
-
Inspect what the proxy forwards
- If you have access to logs (on the gateway/load balancer and/or origin), look for records showing the host/authority and path seen by each hop.
-
Check connection reuse effects
- If the issue appears intermittently, test whether it correlates with HTTP keep-alive, HTTP/2 connection reuse, or browser/client behavior.
-
Compare “good” vs “bad” requests
- Capture two traces: one that succeeds and one that returns 421. Diff headers that influence routing (host/authority and any proxy-related forwarding headers, if your environment uses them).
-
Review intermediary routing configuration
- Ensure that routing rules for the origin selection (host-based routing, path-based routing, or SNI/TLS-based selection) are consistent with how clients connect.
A simple “routing correctness” mindset
When troubleshooting 421, treat the request like it must prove it belongs to the connection/session context already selected by the intermediary. If it cannot, the intermediary may refuse to route it and instead returns 421.
Related Concepts to Know
- Reverse proxies and gateways: Components that terminate connections and make routing decisions.
- Load balancing: Distributes requests, often using routing rules that depend on request metadata.
- Host/authority-based routing: Common approach where the requested host determines the origin.
- Connection reuse: When a client or intermediary reuses an existing connection for multiple requests, correlating the “right destination context” becomes important.
