Skip to main content
HTTP/4xx (Client Error)

499 Client Closed Request

Non-standard Nginx code logged when the client closes the connection before the server sends a response.

❓ Why does this happen?

The upstream (Node.js, PHP-FPM, Python) is too slow, so the browser, load balancer, or mobile client gave up waiting.

✅ How to fix it

Profile slow upstream handlers, add caching, and align client, load balancer, and proxy_read_timeout values.

Return or handle 499 in your stack

// Note: 499 is normally generated by Nginx, not your app.
// Emitting it yourself is only useful for testing client error handling.
// app/api/resource/route.ts
export function GET() {
  return Response.json(
    { error: "Client Closed Request", status: 499 },
    {
      status: 499
    }
  );
}

Live 499 mock endpoint

Point your app, tests, or retry logic at this free public URL to reproduce a real 499 response (CORS enabled, optional ?delay=ms up to 5000).

https://castov.com/api/mock/499

499 vs similar status codes

Frequently Asked Questions

What does HTTP Status 499 mean?
Non-standard Nginx code logged when the client closes the connection before the server sends a response.
Why am I getting a 499 status code?
The upstream (Node.js, PHP-FPM, Python) is too slow, so the browser, load balancer, or mobile client gave up waiting.
How do I fix a 499 Client Closed Request error?
Profile slow upstream handlers, add caching, and align client, load balancer, and proxy_read_timeout values.
What is the difference between 499 Client Closed Request and 504 Gateway Timeout?
499 means the client gave up waiting and closed the connection; 504 means the proxy gave up waiting for the upstream.
How can I test how my app handles a 499 response?
Send a request to https://castov.com/api/mock/499 — it returns a real 499 Client Closed Request response with CORS enabled. Add ?delay=2000 to simulate a slow server.

Other 4xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.