Skip to content
4xx · client errorSent by Nobody · logged by the proxyNon-standard · nginx

499Client Closed Request

The client gave up and closed the connection before the server had answered. Nobody receives this code.

How you get a 499

The app is slow. The client waits its own 30 seconds, gives up and closes the connection. The proxy logs 499. No response is sent, because nobody is listening any more.

Who sends itNobody · logged by the proxy

  1. Browser
  2. CDN
  3. Proxy
  4. App
  5. DB

Nobody sends it. The client closes the connection, and nginx writes 499 in its own access log to record that. It is specific to nginx and never travels over the network.

In short

What a 499 Client Closed Request means

499 is not part of HTTP. It is a number nginx writes in its access log when the client closes the connection before nginx could send a response. No one receives a 499: the browser, app or load balancer on the other end has already left. It appears when the client's patience is shorter than the server's response time. A mobile app with a ten second timeout, a user who clicks away, a health checker, or another load balancer in front of nginx with its own idle timeout can all cause it. The application is often still working when the client leaves, and may finish the job for nobody. Clients that hang up usually retry, so a burst of 499s can also mean the same slow work is being started again and again.

Common causes of a 499

  1. 1The client's timeout is shorter than the time the server needs.

    How to check: If your log format includes $request_time, the 499 entries sit just above a round number: the client's timeout.

    grep -c ' 499 ' /var/log/nginx/access.log
  2. 2Another load balancer or CDN in front of nginx hit its own timeout and hung up.

    How to check: The 499s line up with timeouts reported by that product, and the times match its limit.

  3. 3Users navigate away, close the tab or press stop while a slow page loads.

    How to check: The 499s are spread over many durations and concentrate on slow pages.

  4. 4A health checker or monitor with a very short timeout.

    How to check: The entries share one user agent and one path.

Retry or not?

Safe to retry with backoff · Idempotent requests only

The client never got an answer, so it does not know whether the work happened. It may well have. Retry reads freely; retry writes only if they carry an idempotency key.

Headers that matter

(none)
No response is sent, so there are no response headers. Everything you can learn is in nginx's access log.
$request_time
An nginx log field, not a header. It shows how long the client waited before leaving.
X-Request-Id
A common convention. Use it to find the same request in the app's log and see whether it finished.

In the real world

RFC vs real deployments

No RFC defines 499; nginx invented it for its logs, and a few other products have copied the idea. The standard has nothing to say because, from HTTP's point of view, nothing was sent. Whether the application stops working when the client leaves depends on configuration: by default nginx closes its connection to the upstream, but many applications carry on to the end regardless.

Seen in a real outage

Clients that give up tend to try again, and the retries arrive on top of the work already under way. At Facebook in 2010, clients re-querying a database after errors kept it overloaded after the original fault had been fixed.

Your turn

Which code is it?

nginx's access log fills with status 499, each with a request time of just over 10 seconds. The app's log shows the same requests completing with 200 after 12 to 15 seconds. What is happening?

499 questions

Is 499 a real HTTP status code?
No. It is not in any HTTP standard. nginx uses it in its access log to mark requests where the client closed the connection before a response was sent.
Who sends a 499?
Nobody. The client disconnects, and nginx records 499 for its own bookkeeping. The client never sees the number.
What is the difference between 499 and 504?
It is about whose timer ran out. With 499 the client stopped waiting and left. With 504 the proxy stopped waiting for the server behind it and told the client so.

Sources: nginx: development guide, HTTP status codes ↗ · nginx: proxy_ignore_client_abort ↗ · Report a problem

Diagrams are our own simulations. All wording is original and paraphrases the linked sources.

Practise this in the DNS / HTTP track

Two-minute animated lessons, then boss fights from real outages. Free, no account needed.

Start the track