HTTP 421 — Misdirected Request
HTTP 421 is a connection-reuse trap: the request reached a server that is technically answering on the port but has no certificate or authority to answer for the requested hostname — a symptom of HTTP/2 connection sharing gone wrong.
When 421 shows up
- HTTP/2 coalesced connections routed to the wrong virtual host.
- CDN edges receiving hostnames they do not terminate certificates for.
Mocking a 421 response
A response with this status can be faked end to end with a local mock rule — no backend changes needed. The configuration below mirrors the rule fields the ApiSimul editor uses (method, path, status, delay in milliseconds, response body):
{
"method": "GET",
"path": "/api/data",
"status": 421,
"delay": 180,
"enabled": true,
"body": null
}Dynamic placeholders such as {{random.name}}, {{string.uuid}} or {{number.int 1 100}} can appear inside the body to vary each response, which keeps client-side list rendering and retry logic honest during development.
Frequently asked questions
What does HTTP 421 mean?
The server answering the connection is not the right authority for this request URI. Re-establishing a connection to the correct host resolves it.
How can I test a 421 response without a real backend?
Define a mock rule with the method and path your client requests and set the status to 421. The example configuration above returns this response after the listed delay, so the client exercises its 421 handling exactly as it would against a live server.
Related status codes
Need the response in your own project? Spin up rules for any status with the ApiSimul mock server, or browse every status code page.