499 Client Closed Request
An nginx log entry, not a response. The client closed the connection while nginx was still working on the request, so there was nobody left to answer.
What 499 means
499 is not an HTTP status code and is not in the IANA registry. nginx defines it for its own bookkeeping: HTTP has no code for a client that hangs up while its request is being processed, so nginx invented one to write in the access log when that happens before it has started sending the response header.
By definition no client ever receives a 499. If your monitoring shows them, you are looking at nginx's $status log field. What the person or program at the other end experienced was a timeout or a cancelled request of their own making.
nginx has a few more internal codes of this kind, such as 444, which a configuration can return to close a connection without sending anything.
Why clients close early
- The client's own timeout expired. An HTTP library configured to wait 10 seconds calls an endpoint that takes 12.
- Something in front of nginx gave up. A load balancer or CDN has an idle timeout shorter than your slow requests. It returns 504 (or 524 on Cloudflare) to the real client and closes its connection to nginx, which logs 499.
- A person moved on. They closed the tab, pressed stop, followed another link or lost signal.
- The front end cancelled the request. Search-as-you-type interfaces abort the previous request on every keystroke. These 499s are harmless.
- A health checker with a short timeout, or one that disconnects as soon as it has seen what it needs.
Telling harmless from harmful
Add timings to the access log and the pattern usually explains itself:
log_format timed '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" "$http_user_agent" '
'rt=$request_time urt=$upstream_response_time';
- Request times bunched at a round number (10.0, 30.0, 60.0 seconds) mean a configured timeout upstream of nginx, in the client or a load balancer. The endpoint is too slow for it.
- Short, scattered request times on pages and autocomplete endpoints are people and scripts cancelling. A steady low rate is normal for any busy site.
- A sudden rise across many URLs means the application or a dependency has slowed down and callers are running out of patience. Treat it like a rise in 504s.
The error log has a matching entry at info level, client prematurely closed connection, which you will only see if error_log is set to log that level.
What to do about it
- Fix the slow endpoint. The 499 is a symptom; the cause is a response that takes longer than its callers will wait.
- Line the timeouts up. Each layer should wait a little longer than the one behind it: the client longer than the load balancer, the load balancer longer than nginx's
proxy_read_timeout. Then the layer closest to the problem reports it, with a real status code. - Decide what happens to abandoned work. By default (
proxy_ignore_client_abort off) nginx closes the upstream connection when the client goes away. Whether the application notices and stops is up to the application. Setting the directive toonlets the upstream request run to completion. - Make retries safe. A client that timed out will often send the request again while the first is still running. Idempotency keys stop that from creating duplicates.
- Leave them out of error-rate alerts, or alert on them separately. They are not server failures.
499 compared with 408, 504 and 444
| Code | Who gave up | Seen by the client? |
|---|---|---|
| 499 (nginx log) | The client, waiting for the response | No; it has already disconnected |
| 408 Request Timeout | The server, waiting for the client to send the request | Yes, if it is still listening |
| 504 Gateway Timeout | A proxy, waiting for the upstream's response | Yes |
| 444 (nginx) | nginx, on purpose, by configuration | No; the connection is closed with no response |
Example 499 response
203.0.113.24 - - [14/Nov/2026:09:41:07 +0000] "GET /api/reports/annual HTTP/1.1" 499 0 "-" "python-requests/2.32.3"There is no response to show, because none was sent. This is the line nginx writes to its access log in the default combined format: status 499 and 0 bytes sent. The user agent suggests a script whose own timeout ran out.
Documented in nginx source, ngx_http_request.h.
Questions
Is 499 a real HTTP status code?
No. It is a code nginx made up for its logs, to record that the client closed the connection before nginx had sent a response. It is not registered, and it is never sent over the network.
Are 499 errors a problem?
A small, steady number is normal: people close tabs and front ends cancel requests. They are a problem when they rise suddenly or cluster on slow endpoints, because that means callers are timing out before your server answers.
Why does nginx log 499 while the user sees a 504?
A load balancer or CDN sits in front of nginx with a shorter timeout. It gave up, sent its own 504 to the user and closed its connection to nginx. From nginx's point of view the client, meaning the load balancer, went away.
How do I stop nginx 499 errors?
Make the slow requests faster, or raise the timeout of whatever is calling nginx so that it waits long enough. Setting proxy_ignore_client_abort on does not prevent the client from leaving; it only lets the upstream request finish.