414 Request-URI Too Large / 400 Request Header Or Cookie Too Large Nginx / Apache Origin: Edge & web server OSI layer 7 · Application Last updated 5 Nov 2026

Nginx: 400 Bad Request — Request Header Or Cookie Too Large / client sent too long header line

The request line or headers (often cookies) exceed large_client_header_buffers.

Exact message you may see 400 Bad Request Request Header Or Cookie Too Large nginxclient sent too long header lineclient sent too long URI while reading client request line414 Request-URI Too Large nginxRequest Header Or Cookie Too Large
Seen on: Nginx Linux

Meaning

Raise large_client_header_buffers 4 16k; (and client_header_buffer_size 4k), and reduce cookie bloat: remove old cookies, shorten session data. Typical after apps set many/huge cookies (analytics, auth tokens). Also affects very long query strings (414).

Common causes

  • Large or many cookies
  • Very long URLs (414)
  • Big JWTs in headers
  • Default 8k header buffer
  • Cookies accumulating on a shared parent domain

⚡ Quick fix

  1. large_client_header_buffers 4 16k; in http/server
  2. Clear/shrink cookies; store less in cookies
  3. Use POST for large payloads instead of query strings

Detailed fix by platform

Nginx

  1. http { client_header_buffer_size 4k; large_client_header_buffers 4 16k; }

How to diagnose

  1. Header — Cookie size?
  2. URL — Too long?
  3. Buffers — Value?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Edge & web server. Errors that are often confused with or caused by this one (click to open):

100 — HTTP 100 Continue (HTTP)1001025 — Cloudflare Error 1025: Please check back later (Workers request limit) (Cloudflare)1025103 — HTTP 103 Early Hints (HTTP)1031040 — Cloudflare Error 1040 / 1041: Invalid request header modification (Cloudflare)10401102 — Cloudflare Error 1102: Worker exceeded resource limits (CPU time / memory) (Cloudflare)1102400 — HTTP 400 Bad Request (HTTP)400411 — HTTP 411 Length Required (HTTP)411413 (Cloudflare 100 MB) — Cloudflare 413 Request Entity Too Large (upload over the plan limit) (Cloudflare)413 (Cloudflare 100 M…414 Reque…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.