Request Header Too Large
ActiveHTTP 494 Request Header Too Large is an Nginx-proprietary status code indicating the client sent request headers that exceeded the configured limit. Nginx's default large_client_header_buffers limit is 4 × 8KB. Common causes: extremely large cookies, long Authorization tokens (JWT), or URL query strings embedded in headers.
Description
Nginx returns 494 when the total request header size exceeds large_client_header_buffers configuration. This is distinct from 431 Request Header Fields Too Large (the RFC-standard equivalent). The most common trigger is a JWT access token in an Authorization header that has grown too large due to many embedded claims. Fix by increasing Nginx's buffer size or reducing header payload size. The equivalent in Apache is a 400 Bad Request.
Examples
# nginx.conf
http {
large_client_header_buffers 4 32k;
# Default is 4 8k – increase for large JWTs
}Edge Cases
- •494 is Nginx-specific. Apache and other servers return 400 Bad Request for the same condition.
- •The 431 status code is the RFC-standard equivalent – use it in application code, not 494.
- •Large JWT tokens are the most common trigger. Consider moving claims to a smaller token and fetching user data from an API instead.
When You'll See This
- →JWT access token too large for Nginx default buffer
- →Accumulation of many cookies exceeding header size limit
- →Long URL in custom header field
Implementation References
| Language | Constant |
|---|---|
| Nginx | 494 (NGX_HTTP_REQUEST_HEADER_TOO_LARGE) |
| Go | 494 (no standard constant) |
History
Nginx introduced 494 to distinguish header-size errors from other 400 Bad Request conditions. The RFC-standard 431 Request Header Fields Too Large was defined later in RFC 6585 (2012).
Related Status Codes
FAQ
What is the difference between 494 and 431?
494 is Nginx-specific and returned at the reverse proxy level. 431 is the RFC-standard status code that application servers should return. Both indicate the request headers are too large.