HTTP 400 status code (Bad Request) - Amazon CloudFront
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

HTTP 400 status code (Bad Request)

Your CloudFront distribution might send error responses with HTTP status code 400 Bad Request, and a message similar to the following:

The authorization header is malformed; the region '<Amazon Region>' is wrong; expecting '<Amazon Region>'

For example:

The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-west-2'

This problem can occur in the following scenario:

  1. Your CloudFront distribution's origin is an Amazon S3 bucket.

  2. You moved the S3 bucket from one Amazon Region to another. That is, you deleted the S3 bucket, then later you created a new bucket with the same bucket name, but in a different Amazon Region than where the original S3 bucket was located.

To fix this error, update your CloudFront distribution so that it finds the S3 bucket in the bucket's current Amazon Region.

To update your CloudFront distribution
  1. Sign in to the Amazon Web Services Management Console and open the CloudFront console at https://console.amazonaws.cn/cloudfront/v4/home.

  2. Choose the distribution that produces this error.

  3. Choose Origins and Origin Groups.

  4. Find the origin for the S3 bucket that you moved. Select the check box next to this origin, then choose Edit.

  5. Choose Yes, Edit. You do not need to change any settings before choosing Yes, Edit.

When you complete these steps, CloudFront redeploys your distribution. While the distribution is deploying, you see the Deploying status under the Last modified column. Some time after the deployment is complete, you should stop receiving the AuthorizationHeaderMalformed error responses.