# HTTP/1.1 431 Request Header Fields Too Large

- **ID:** `communication/http-431-request-header-fields-too-large`
- **Domain:** communication
- **Category:** resource_error
- **Error Code:** `431`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

The total size of HTTP request headers exceeds the server's configured limit (typically 8 KB to 16 KB).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| nginx 1.26.0 | active | — | — |
| Apache HTTP Server 2.4.59 | active | — | — |
| Node.js 22.0.0 | active | — | — |

## Workarounds

1. **Increase the server's request header buffer size. For Nginx: 'large_client_header_buffers 4 32k;' in http or server block. For Apache: 'LimitRequestFieldSize 16380' in httpd.conf.** (95% success)
   ```
   Increase the server's request header buffer size. For Nginx: 'large_client_header_buffers 4 32k;' in http or server block. For Apache: 'LimitRequestFieldSize 16380' in httpd.conf.
   ```
2. **Reduce cookie sizes or move large state to server-side sessions. Example in Express.js: app.use(session({ store: new RedisStore(), cookie: { maxAge: 60000 } })) — store session data server-side instead of in cookies.** (85% success)
   ```
   Reduce cookie sizes or move large state to server-side sessions. Example in Express.js: app.use(session({ store: new RedisStore(), cookie: { maxAge: 60000 } })) — store session data server-side instead of in cookies.
   ```

## Dead Ends

- **Increase server memory or CPU** — The error is a hard limit on header size, not a resource shortage; memory increase does not affect the limit. (90% fail)
- **Disable all security modules or firewalls** — Most security tools do not cause this error; disabling them may expose the server without fixing the header size issue. (50% fail)
