What 499 means
Not a real HTTP response. nginx writes 499 in its access log when the client closed the connection before nginx had sent a response. The client never receives it.
When servers send it
When users navigate away, close a tab, or cancel a request, or when a client or load balancer in front of nginx times out first.
Common causes
- A slow backend: the user or client gave up waiting.
- A load balancer or client with a shorter timeout than nginx.
- Single-page apps cancelling requests that are no longer needed.
- Health checks with very short timeouts.
How to fix it as a developer
- A few 499s are normal. Lots of them mean responses are too slow. Check the
request_timein your logs. - Make sure timeouts line up: the client or load balancer should wait at least as long as nginx and your app.
- Note nginx usually stops waiting for the upstream once the client is gone, unless
proxy_ignore_client_abortis on.
How to fix it as a visitor
- Nothing to fix: you probably closed the page or the request was cancelled. If pages keep failing to load, try again later.
Related codes
- 408 Request Timeout: The server gave up waiting for the client to finish sending its request.
- 504 Gateway Timeout: A proxy or load balancer gave up waiting for the server behind it to reply.
- 444 No Response: nginx closed the connection without sending anything. You’ll only see it in nginx’s logs.
- 502 Bad Gateway: A proxy or load balancer got an invalid response, or none at all, from the server behind it.
Where it’s defined
499 isn’t in any RFC or the IANA status code registry. It’s used by nginx. Reference: Not in the IANA registry.
Other 4xx codes
400 Bad Request · 401 Unauthorized · 402 Payment Required · 403 Forbidden · 404 Not Found · 405 Method Not Allowed · 406 Not Acceptable · 408 Request Timeout · 409 Conflict · 410 Gone · 413 Content Too Large · 414 URI Too Long · 415 Unsupported Media Type · 418 I’m a teapot · 422 Unprocessable Content · 429 Too Many Requests · 431 Request Header Fields Too Large · 451 Unavailable For Legal Reasons
Or search them all in the HTTP status code list.