499 status code: when the client gives up first
A 499 status code, Client Closed Request, is a non-standard code that nginx, and the proxies built on it, log when the client closed the connection before the server sent a response. The browser never sees it; it only shows in the server’s logs and metrics.
Why a 499 matters
A 499 usually means a user or an upstream proxy gave up waiting. A few from people closing a tab are normal. A run of them on one endpoint means that endpoint is slow, and often comes just before 504 timeouts.
What causes 499s
- Slow responses that users abandon.
- A client or load balancer timeout shorter than the time the server takes.
- Mobile clients on poor connections dropping mid-request.
- Health checks with tight timeouts hitting a slow endpoint.
How to fix it
- Compare p95 latency with the client timeout. If they are close, the endpoint is the problem.
- Speed up the work, or move it out of the request into a background job.
- Line up the timeouts so the proxy closest to the user waits longest and the app gives up first, with a proper error.
Is 499 a client error or a server error?
It sits in the 4xx range because the client closed the connection. In practice it is usually the server’s problem: the client left because the answer took too long. That is why it belongs with the 5xx errors when you measure how many requests failed.