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
- Verify request routing path in load balancer
- Check server configuration for hosted domains
- Inspect SNI or Host header in TLS handshake
- 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.