NGINX 400 "Request Header Or Cookie Too Large"

Symptom

One browser suddenly gets 400 on every request; incognito works.

Root cause

Cookie bloat exceeded large_client_header_buffers (default 8k).

Fix, in order

1. Confirm by clearing cookies# if clearing cookies fixes it, this is your bug
2. Raise the bufferslarge_client_header_buffers 4 16k;
3. If proxying, raise proxy_buffer_size tooproxy_buffer_size 16k; proxy_buffers 8 16k;

Prevent it coming back

Audit cookie size growth in your app (looking at you, trackers).

Run it on clean infra

Spinning up a fresh box to reproduce or escape this error?

Managed cloud hosting

Related

Cloud & DevOps tool comparisons · Hardware build guides

NinjaOps publishes free engineering guides. Some outbound links are affiliate links: they cost you nothing and support the site.

Last reviewed 2026-10-02 · NinjaOps SEO grid · DevOps blog