421 Misdirected Request HTTP Status Code

Description

HTTP status code 421 (Misdirected Request) indicates that the request was directed at a server that is not able to produce a response. This can occur for several reasons, but often it's related to the HTTP/2 protocol.

In HTTP/2, servers can reuse connections for multiple requests. However, if a request is sent over a connection that was established with another server (e.g., through an intermediary or due to misconfiguration), the server might not be able to properly handle the request because it's intended for another service or endpoint. When this happens, the server returns a 421 Misdirected Request status code.

This status code is a way for the server to tell the client that it needs to try sending the request to another server or through a different route. It's also a signal that there might be a misconfiguration in the network or that the request has been improperly routed.

The client can then take appropriate action, which usually involves retrying the request to a different server or adjusting the connection settings to prevent misdirected requests in the future.

Status

HTTP
421 Misdirected Request

Common Causes

HTTP Status Code 421 Misdirected Request is quite specific and is not as commonly encountered as other HTTP status codes. It occurs under the following circumstances:

  1. HTTP/2 Server Configuration: This status code is primarily related to HTTP/2. It indicates that the server refuses to process the request because it was directed at a server that is not able or willing to produce a response. This can happen when the server configuration does not allow serving the requested host or domain.

  2. Server is Not Configured for the Requested Address: It means that the server is not configured to produce responses for the combination of scheme and authority that are included in the request URI. For example, if a request is sent to a server that is configured to serve only a specific domain or subdomain, but the request header includes a different domain or subdomain, the server might respond with a 421 status code.

  3. TLS (SSL) Certificate Misconfiguration: In environments where servers are using SNI (Server Name Indication) to serve multiple domains over the same IP address, a mismatch or misconfiguration in TLS certificates can cause this error. If the client indicates a server name that does not match any of the server’s certificates, and the server cannot securely accept the request, it might respond with a 421 status code.

  4. Load Balancers or Reverse Proxies: In setups involving load balancers or reverse proxies that forward requests to different backend servers, a misconfiguration or routing issue could lead to a situation where the backend server believes it's receiving a request meant for another server. This might prompt a 421 response.

  5. HTTP/2 Connection Reuse: With HTTP/2, connections between clients and servers can be reused for multiple requests across different domains or hostnames, provided those domains resolve to the same IP address. If the server decides that a particular request cannot be processed using the current connection, possibly due to server policies about the requested host, it might issue a 421 response.

In practice, encountering a 421 error should prompt an investigation into server configuration, including the handling of HTTP/2 connections, SNI setup, and the proper configuration of domains and TLS certificates. It's a signal that there's a mismatch between the client's request and the server's ability to handle that request under its current configuration.

Browser Support

The following table will show you the current browser support for the 421 Misdirected Request HTTP status code.

Desktop
Edge Chrome Firefox Opera Safari
?????
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
??????

Last updated by CSSPortal on: 1st April 2024