400 Bad Request Checklist
400 Bad Request? Separate malformed syntax from oversized headers or cookies, then see which layer rejected it. Free instant check, no sign-up.
Check your domain for this issue now
Free, no sign-up. Runs the exact check this guide describes and shows what to fix.
Problem
The final response code for the request is 400 Bad Request.
Symptoms
- HTTP Check shows a final status code of 400.
- The browser shows a plain “Bad Request” page, sometimes with “Request Header Or Cookie Too Large.”
- It may hit one client and not another, or clear after you delete cookies for the site.
What 400 Actually Means
RFC 9110 (§15.5.1) defines 400 as the server being unable or unwilling to process the request “due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).” The key word is perceived: the server has decided the request is broken before it even tries to fulfill it, so it never reaches your application logic.
That makes 400 different from a 500. A 500 is the application failing on a request it accepted. A 400 is the request being rejected at the door. The spec also notes a client “SHOULD NOT repeat the request without modifications” — sending the identical bytes again will earn the identical 400.
Top 3 Causes
- Oversized headers or cookies - The most common 400 people actually hit. Accumulated cookies, a large JWT, or a flood of proxy-added headers overflow the server’s buffer. nginx reports this as
400 Request Header Or Cookie Too Largebecause itslarge_client_header_buffersdefault (8KB per line) is exceeded. - Malformed request syntax or framing - A buggy client, broken proxy, or hand-crafted request sends an illegal character in the URL, a bad
Content-Length, or invalid HTTP framing. The server can’t parse it, so it refuses. - Host or routing mismatch - A
Hostheader that matches no server block, an SNI/Host mismatch behind TLS, or a proxy that rewrites the request into a shape the origin treats as deceptive routing.
Diagnose with DechoNet
- HTTP Check to confirm the final code is 400 and inspect the response — including whether the body names an oversized header or cookie.
- DNS Lookup to confirm the request is reaching the intended host, ruling out a
Host/routing mismatch sending you to the wrong server block.
Resolution Checklist
- Clear cookies for the affected site, then retry — this fixes the “Header Or Cookie Too Large” variant immediately.
- If you control the server, raise
large_client_header_buffers(nginx) or the equivalent header limit, and find what is inflating the headers. - Reproduce with a clean client (incognito, a fresh
curl) to separate a client-side problem from a server-side one. - Inspect the exact request bytes for illegal characters, a wrong
Content-Length, or bad framing — often introduced by a proxy in the path. - Confirm the
Hostheader matches a configured virtual host and isn’t being rewritten upstream. - Re-run HTTP Check and confirm the response is no longer 400.
When to Escalate
- Escalate to whoever runs the reverse proxy or CDN if the 400 originates at the edge and you can’t change the header limits.
- If the malformed request comes from a third-party client or SDK you don’t control, take the captured request bytes to its maintainer.
Related Tools
Related Guides
Share this guide