# nginx Error 499: Client Closed Request

> An nginx log code: the client closed the connection before the server sent a response.

499 is an nginx-specific code that you'll find in access logs, never in a browser. It records that the client — a browser, a load balancer's health check, a mobile app — gave up while nginx was still waiting on the upstream application. Nothing was sent back, so the client never sees a 499.

- Class: unofficial (nginx)
- Retry: Not applicable
- Cacheable by default: no
- Defined in: [nginx — proxy_ignore_client_abort](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ignore_client_abort)

## Example response

```http
HTTP/1.1 499 Client Closed Request
Content-Type: application/json
Content-Length: 33

{"error":"Client Closed Request"}
```

## Common causes

- Users navigating away from, or cancelling, a slow request.
- Client timeouts shorter than the backend's response time — an app or load balancer giving up after 30 s while the backend takes 40 s.
- Health checks with aggressive timeouts.

## How to fix it

1. Find out why the upstream is slow — 499s cluster on the slowest endpoints.
2. Align timeouts so clients wait longer than the backend's expected response time, or make the backend faster.
3. To keep processing even after the client leaves, set `proxy_ignore_client_abort on;`.

## FAQ

### Is 499 a client error or a server error?

It's logged as client-side because the client disconnected, but the root cause is often a slow backend. Treat a spike in 499s like a spike in latency.

## Related status codes

- [408 Request Timeout](https://www.devkult.com/http/408.md)
- [504 Gateway Timeout](https://www.devkult.com/http/504.md)
- [502 Bad Gateway](https://www.devkult.com/http/502.md)

Open the interactive page: https://www.devkult.com/http/499