Nginx 499 Client Closed Request: what it means
Short answer
499 is an nginx-specific code that only appears in access logs: the client closed the connection before nginx answered. Many 499s usually mean a slow backend and a CDN or load balancer in front that gave up first. Find the slow requests, then align timeouts across layers.
Most common cause: The backend is slow and the user reloaded or closed the page.
Try this first: Log timings to find slow requests
log_format timed '$remote_addr [$time_local] "$request" $status '
'rt=$request_time urt=$upstream_response_time';
access_log /var/log/nginx/timed.log timed;Last verified: · against the official docs listed below · Sources
Typical log lines
203.0.113.7 - - [14/Nov/2026:10:00:00 +0800] "POST /api/export HTTP/1.1" 499 0 "-" "Mozilla/5.0" epoll_wait() reported that client prematurely closed connection, so upstream connection is closed too while sending request to upstream
Common causes
- The backend is slow and the user reloaded or closed the page.
- A CDN, load balancer or API gateway in front has a shorter timeout than the backend needs and drops its connection to nginx.
- Health checks or monitors use very short timeouts.
- Client code cancels requests on purpose (front-end aborts on navigation).
Diagnosis commands
awk '$9==499' /var/log/nginx/access.log | awk '{print $7}' | sort | uniq -c | sort -rn | headawk '$9==499' /var/log/nginx/access.log | wc -ltime curl -s -o /dev/null http://127.0.0.1:3000/api/exportFix configs
Log timings to find slow requests
log_format timed '$remote_addr [$time_local] "$request" $status '
'rt=$request_time urt=$upstream_response_time';
access_log /var/log/nginx/timed.log timed;Let long jobs finish on the backend (optional)
location /api/export {
proxy_ignore_client_abort on; # keep waiting for the backend after the client disconnects
proxy_read_timeout 300s;
proxy_pass http://127.0.0.1:3000;
}Run nginx -t first, then systemctl reload nginx.
Key facts and sources
- proxy_ignore_client_abort defaults to off: when the client disconnects, nginx also closes the upstream connection. [nginx.org]
- $request_time counts from the first byte read from the client, in seconds with millisecond resolution. [nginx.org]
Checked against the linked pages on 2026-11-14; the official docs win if a newer nginx changes them.
FAQ
Is 499 an error I must fix?
A few 499s are normal (users leave). Many on a few endpoints, or clustered around a CDN timeout, mean the backend is too slow.
Why don't browsers show 499?
The connection is already gone, so 499 is never sent; it is only written to nginx's access log.
Fix it with a tool
Related errors
VPS / CDN recommendations may appear here later, labelled as affiliate links. There are no referral links today.