HTTP Status Codes / 4xx HTTP Status Codes / HTTP 499

499 Client Closed Request (nginx)

This is an educational reference page about HTTP 499 Client Closed Request. The page itself is served as 200 OK so it can be indexed as HTTP documentation.

Used by nginx to log a request whose client closed the connection before nginx sent the response header.

Specification

Not registered in the IANA HTTP Status Code Registry. nginx defines it as NGX_HTTP_CLIENT_CLOSED_REQUEST because HTTP has no code for a client that closed the connection.

What it means

HTTP 499 Client Closed Request is a non-standard code. nginx logs it when the client closes the connection before nginx sends a response.

Common causes

Where you see it

How to fix it

Examples

nginx log format with request time

log_format timed '$remote_addr "$request" $status '
                 '$body_bytes_sent rt=$request_time';
access_log /var/log/nginx/access.log timed;

203.0.113.7 "GET /api/reports/export HTTP/1.1" 499 0 rt=60.002

Common mistakes

Developer notes

499 is not in the IANA registry. The primary source is the comment above NGX_HTTP_CLIENT_CLOSED_REQUEST in nginx's src/http/ngx_http_request.h: HTTP does not define a code for a client that closed the connection, so nginx introduced its own code to log that case. Other platforms reuse the number for a cancelled request.

Questions

What does HTTP 499 mean?

HTTP 499 Client Closed Request means the client closed the connection before the server responded. nginx logs it. It is not a standard HTTP status code.

Does the client receive a 499?

Not from nginx. The client has already disconnected, so the 499 exists only in the access log. A gRPC gateway can send 499 as a real status when a call ends with CANCELLED and the client is still connected.

Is 499 a client error or a server problem?

The code is in the 4xx range because the client ended the request. The cause is often a slow upstream or a timeout mismatch, so check $request_time on 499 entries before deciding.

How do I fix 499 errors in nginx?

Find out why clients give up. Compare $request_time with client and load balancer timeouts, speed up slow upstream responses, and use proxy_ignore_client_abort only when the upstream must finish its work.

Why does gRPC map CANCELLED to 499?

Google's API error model maps CANCELLED, an operation cancelled by the caller, to HTTP 499 Client Closed Request. grpc-gateway and Armeria use the same mapping.

See also

4xx client error – the request contains bad syntax or cannot be fulfilled


HTTP status code lookup
REST API status code chooser
cURL command generator
By Ping Now, a website/API/service uptime monitor
Data from Wikipedia