HTTP 499 Client Closed Request

Non-standard, from nginx: the client closed the connection before the server sent a response. nginx writes it to the access log; no client ever receives it over the wire.

Non-standard — not defined by any RFC. Vendor documentation: nginx source — NGX_HTTP_CLIENT_CLOSED_REQUEST

Where you meet HTTP 499 in production

In nginx access logs, next to requests from mobile clients on flaky networks, from load balancers with short health-check timeouts, and from browsers whose users navigated away. It shows up most around slow endpoints, because those are the requests clients give up on.

Why you would test it

Useful for testing log parsing and dashboards, and as a reminder that a client-side timeout leaves a 499 behind on the server — the request may still have run to completion.

What your client should do about a 499

There is nothing to handle on the client: by definition the client already left. On the server, read a rise in 499s as "clients time out before we answer" — compare the endpoint's latency with the client timeouts and decide which one to move. Remember the work may have completed anyway, so retries need idempotency.

499 versus the codes it gets confused with

Endpoints that return 499

1 endpoint in this playground answers with 499. Every one is free, needs no signup, and can be called from the browser or with curl.

Questions about HTTP 499

Can a browser ever see a 499?
No. The connection is already closed when nginx records it. This endpoint returns 499 on request so you can test code and dashboards that read the status, not because a real client would receive it.
Did the request run?
Possibly to completion. nginx stops sending, but the upstream application may have finished the work — which is why a 499 on a POST is a reason to check for a duplicate on retry.

Other client error codes

All HTTP status codes · All 55 mock REST APIs · Getting started guide

Last updated