Nginx 400 Bad Request: Request Header Or Cookie Too Large

Client sent oversized cookies or JWT headers exceeding `large_client_header_buffers`.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: Nginx 400 Bad Request Platform: Nginx
Common Root Causes:
  • Client sent oversized cookies or JWT headers exceeding `large_client_header_buffers`.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Trim oversized cookies/tokens and raise `large_client_header_buffers 4 16k;` if needed.
Safe Diagnostic Command:
tail -n 30 /var/log/nginx/error.log
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

Client sent oversized cookies or JWT headers exceeding `large_client_header_buffers`. Recommended diagnostic: `tail -n 30 /var/log/nginx/error.log`. Remediation: Trim oversized cookies/tokens and raise `large_client_header_buffers 4 16k;` if needed.

Worked Examples

  • Run `tail -n 30 /var/log/nginx/error.log` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-nginx-400-header-or-cookie-too-large · Independently verified: 2026-11-25

Related Resources