Example HTTP Response
HTTP/1.1 421 Misdirected Request- Request sent to wrong server in cluster
- TLS certificate mismatch
- HTTP/2 connection reuse issue
What does this mean?
Wrong door! You knocked on a server that can't help you with this particular request. Try another one!
Technical Definition
The request was directed at a server that is not able to produce a response.
RFC Says
"The 421 (Misdirected Request) status code indicates that the request was directed at a server that is not able to produce a response. This can be sent by a server that is not configured to produce responses for the combination of scheme and authority that are included in the request URI."
Plain English:
421 means 'You sent your request to the wrong server.' This is mainly relevant for HTTP/2 and HTTP/3 where connection reuse is common. It tells the client 'I received your request, but I'm not the right server to handle this domain/hostname - try connecting directly to the right server instead.'
Common Misinterpretation
This is specific to HTTP/2+ connection reuse scenarios. Don't use it in HTTP/1.1 APIs. It's for cases where a server handles multiple domains but can't handle this particular request due to TLS certificate issues or server configuration.
Ready-to-use code for returning this HTTP status in your application:
// Express.js
app.get('/example', (req, res) => {
res.status(421).json({
error: 'Misdirected Request',
message: 'Your error message here'
});
});
// Native HTTP
const http = require('http');
http.createServer((req, res) => {
res.writeHead(421, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({
error: 'Misdirected Request',
message: 'Your error message here'
}));
}).listen(3000);