Amazon S3
- Cause AWS lists
- Bucket was deleted and recreated with the same name in a different AWS Region; the response mentions the authorization header and the region
- Where to look
- The distribution's origin settings
Trace a CloudFront 400 to its cause: an S3 bucket in a different region, ALB header size limits or a malformed request. Includes a test that produces a real 400.
CloudFront returns 400 when the client sent invalid data, or when the origin rejected the request and CloudFront relayed it. AWS documents two origin cases: an S3 origin that moved regions, which returns an AuthorizationHeaderMalformed message, and an Application Load Balancer origin, which rejects oversized headers, malformed requests or an early disconnect.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
viewer ---> CloudFront edge ---> origin
| |
| |-- S3: bucket moved to another region
| | "The authorization header is malformed; the region ..."
| |-- ALB: header too large, malformed request,
| client closed before the full body
|-- 400 relayed to the viewerawselb/2.0 and x-cache: Error from cloudfront. That combination points to an ALB origin rejection relayed by CloudFront rather than an edge rejection, though only the site's owner can confirm its setup.curl -sS -o /dev/null -w "%{http_code}\n" https://httpbin.org/status/400
# expected output: 400For your own distribution, run the first command against your CloudFront domain. Treat a 400 whose server header names your origin as an origin decision. Trimming cookies and custom headers is the usual remedy, and the limit applies to the whole request header, so many small cookies add up.
curl -sI -H "X-Pad: $(head -c 20000 /dev/zero | tr '\0' a)" https://aws.amazon.com | head -8
# observed: HTTP/2 400, server: awselb/2.0, x-cache: Error from cloudfront, via: ... (CloudFront)AuthorizationHeaderMalformed responses.In the CloudFront console choose the distribution that produces the error.
Choose Origins and Origin Groups, select the check box for the S3 origin that moved, then choose Edit.
Choose Yes, Edit. AWS says you do not need to change any settings first.
CloudFront redeploys the distribution. The Last modified column shows Deploying until it finishes, and the errors stop some time after that.
aws s3api get-bucket-location --bucket your-bucket-name4xx status codes other than 429 have no effect on crawl rate, but URLs already indexed that return one are removed from the index. A 400 on a template or asset path is therefore worth catching early. Compare with CloudFront 404 and CloudFront 403, which are the other client-side codes on the same service, and read 4xx errors for how to list affected URLs.3 questions people ask next, answered from the sources on this page.
The request contained invalid data, such as missing or incorrect content in the payload or parameters, or it is a generic client error. CloudFront also relays 400s from origins like S3 and Application Load Balancers.
AWS lists three limits for requests to an ALB origin: 16 KB per request line, 16 KB per single header, and 64 KB for the entire request header.
An S3 origin was deleted and recreated in a different region under the same name, and the distribution still expects the old region. Re-save the origin in the distribution to update it.
Run the free audit, then approve the fixes. Every change can be undone.