Qaynaq LABS · TOOLS

HTTP · 4xx Client Error

421 Misdirected Request

The server cannot produce a response for the target resource because the request was sent to a server that is not authoritative.

When you see this status

  • Request routed to wrong server via proxy
  • Load balancer misroutes request to non-authoritative backend
  • Server receives request for a domain it does not host

Common causes

  • Misconfigured reverse proxy or load balancer
  • DNS misconfiguration pointing to wrong server
  • Server hosting multiple domains without proper SNI handling

How to debug it

  1. Verify request routing path in load balancer
  2. Check server configuration for hosted domains
  3. Inspect SNI or Host header in TLS handshake
  4. Validate DNS records for the target domain

Return this code in your framework

Express (Node.js)
app.get('/wrong', (req, res) => res.status(421).send('Misdirected Request'));
FastAPI (Python)
from fastapi import HTTPException
@app.get("/wrong")
async def wrong_route():
    raise HTTPException(status_code=421, detail="Misdirected Request")
NestJS
@Get('/wrong') @HttpCode(421) wrongRoute() { return 'Misdirected Request'; }
Go (net/http)
http.Error(w, "Misdirected Request", 421)

About HTTP 421

HTTP status code 421 Misdirected Request is part of the 4xx Client Error family. The server cannot produce a response for the target resource because the request was sent to a server that is not authoritative. Understanding it is essential for backend engineers, API designers, and anyone debugging integrations between services.

The Qaynaq Labs HTTP Status Code Explainer covers all standard codes with practical guidance: what triggers them, how to debug them in production, and exactly how to return them from common frameworks. Each code page is hand-curated and verified.

Frequently asked

Can 421 be used for load balancing misroutes?

Yes, it explicitly indicates the request was sent to a non-authoritative server, unlike 502/503 which imply server issues.

Does 421 require TLS?

No, but it is commonly used with HTTPS when SNI misconfiguration occurs. The error applies to any protocol.

How should clients handle 421?

Clients should retry the request with corrected routing, such as updating the Host header or DNS resolution.