494 Request header too large
Request headers exceeding the configured buffer size on nginx or Akamai EAA produce the 494 Request header too large status code.
Usage
The 494 Request header too large status code indicates the server is unwilling to process the HTTP request because the total header size or the content of one or more individual headers exceeds the allowed limit. The standard code for the same condition is 431. 494 predates it and lives on inside nginx and Akamai EAA.
Akamai Enterprise Application Access (EAA) also returns 494 when an HTTP request header or browser cookie exceeds the configured proxy buffer value (default 4 KB). The EAA connector sits between the client and the origin application, enforcing its own buffer limits independently of the backend server configuration.
Example
A client sends a request with an oversized Cookie header. The nginx server records the failure as 494 Request header too large and, in the default configuration, answers the client with a 400 response carrying the built-in error page.
Request
GET /dashboard HTTP/1.1
Host: www.example.re
Cookie: session=abc123...(4096+ bytes)
Response
HTTP/1.1 400 Bad Request
Server: nginx
Content-Type: text/html
Connection: close
<html>
<head><title>400 Request Header Or Cookie Too Large</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<center>Request Header Or Cookie Too Large</center>
<hr><center>nginx</center>
</body>
</html>
The nginx error log records the oversized header:
client sent too long header line: "Cookie: session=abc123..."
Raising the header limits
Three directives govern the threshold. The first
buffer only decides when nginx moves a request to the
large buffers. A header field overflowing one large
buffer, or more header lines than max_headers
allows, produce 494.
| Directive | Default | Overflow |
|---|---|---|
client_header_buffer_size |
1k | Initial read, escalates |
large_client_header_buffers |
4 8k | One field exceeds one buffer |
max_headers |
1000 | Too many header lines |
A single header field has to fit inside one buffer rather than across several, which is why a large Cookie triggers the condition while a long list of ordinary headers passes.
http {
client_header_buffer_size 4k;
large_client_header_buffers 4 16k;
}
Both directives belong at http level. Buffers are
sized before the Host header is parsed, so
a server-level value is read from the default
server rather than the matching one, and the setting
appears to have no effect.
The max_headers directive arrived in nginx 1.29.8
and caps the number of header lines rather than their
size.
An oversized request line produces 414 instead, so an overlong URL and an overlong header land on different codes. The same buffer limits apply on HTTP/2 and HTTP/3, with one difference in how the failure reaches the client. An HTTP/2 field or header block over the limit ends the whole connection with a GOAWAY frame carrying ENHANCE_YOUR_CALM, so the client reports a connection error and never sees a status code. Too many header lines on HTTP/2, and every oversize condition on HTTP/3, finish the request normally with 494 mapped to 400.
Diagnosis needs a raised log level. nginx records "client sent too large request", "client sent too long header line", and "client sent too many header lines" at info level, which the default error log setting discards.
error_log /var/log/nginx/error.log info;
A friendly page catches the internal code rather than the 400 the client sees.
error_page 494 =400 /errors/header-too-large.html;
How to fix
Raise the buffer sizes as shown above when the large headers are legitimate, then reload nginx:
nginx -t && systemctl reload nginx
Reduce header size on the client side. Oversized Cookie headers from runaway cookie growth are the most frequent cause. Clear unnecessary cookies, consolidate tracking cookies, and shorten custom header values.
Audit application cookie behavior. Session frameworks, analytics scripts, and advertising pixels each add cookies. A domain accumulating dozens of cookies over time pushes total header size past default limits.
For Kubernetes environments using nginx Ingress, the buffer sizes are ConfigMap options, not per-Ingress annotations. Set them in the controller's ConfigMap:
client-header-buffer-size: "4k"
large-client-header-buffers: "4 16k"
For Akamai EAA, increase the Proxy Buffer Size in the Advanced tab under the Miscellaneous section for the affected application in the Enterprise Center console.
This error is functionally identical to 431 but specific to nginx and Akamai EAA internal handling.
See also
- 400
- Google: HTTP status codes and network errors
- 414
- 431
- nginx large_client_header_buffers
- HTTP status codes