From AWS support https://forums.aws.amazon.com/thread.jspa?threadID=216814
This is an expected behavior when you create a new bucket. The
following pages explains the concept:
http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html
"Amazon S3 routes any virtual hosted–style requests to the US East (N.
Virginia) region by default if you use the US East (N. Virginia)
endpoint (s3.amazonaws.com), instead of the region-specific endpoint
(for example, s3-eu-west-1.amazonaws.com). When you create a bucket,
in any region, Amazon S3 updates DNS to reroute the request to the
correct location, which might take time. In the meantime, the default
rule applies and your virtual hosted–style request goes to the US East
(N. Virginia) region, and Amazon S3 redirects it with HTTP 307
redirect to the correct region."
Please give some time to S3 until the domain name becomes ready
(normally an hour or so). Also, please note, errors are cached in
CloudFront by default. This means "307 Temporary Redirect" is cached
for 300 seconds unless you change it:
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html
In order to test your cloudfront again, please make sure the cache has
been invalidated:
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html
Hope that helps.
The default cache policy has
Default TTL 86400
That is, 24h, so you may want to invalidate it rather than wait.
From https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html
If you use the AWS command line interface (CLI) for invalidating files
and you specify a path that includes the * wildcard, you must use
quotes (") around the path.
For example: aws cloudfront create-invalidation --distribution-id
distribution_ID --paths "/*"
Another thing you can do if nothing of the above works and you are in development and just want to get something accessible is to change the reference or your bucket from
global — {bucket-name}.s3.amazonaws.com
to
regional — {bucket-name}.s3.{region}.amazonaws.com
As explained on the forum this will bypass the attempt to use the replicated buckets by going just to one, which will not fail and therefore you won't get a redirect.
You will see that easily with curl
$ curl -I http://blah.cloudfront.net/x.svg
HTTP/1.1 307 Temporary Redirect
Content-Type: application/xml
Connection: keep-alive
x-amz-bucket-region: eu-west-1
$ curl -I http://blah.cloudfront.net/x.svg
HTTP/1.1 200 OK
Content-Type: image/svg+xml
Content-Length: 657
Connection: keep-alive