I created a AWS CloudFront distribution with three origins with three different behaviors.
Here are my three buckets with region.
- Seoul - eimages
- Seoul - etxts
- Mumbai - epdfs
Each bucket has a single file
- eimages - Sample.jpg
- epdfs - Sample.pdf
- etxts - Sample.txt
Then I configure the CloudFront behavior as follows
- *.pdf - emages
- *.txt - etxts
- (*) default - eimages
Given that my CloudFront distribution domain is d3ewqer4qpe.cloudfront.net I tried hitting following URLs from the browser and Mumbai bucket is replying with AccessDenied.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>335922B75E760050</RequestId>
<HostId>
a05u8gpKGGM8FjlVyQrMwOqhswEEw0KMR/HbH3S9lJX0MpAlMWsutYYI5ka3FxKeQnwvOdqeiqI=
</HostId>
</Error>
As I can see the redirect URL as
https://eimages.s3.ap-northeast-2.amazonaws.com/Sample.pdf. Seems request request redirected to wrong bucket.
But if I try correcting the URL with correct bucket name and region then its working fine https://epdfs.s3.ap-south-1.amazonaws.com/Sample.pdf and as it seems cached at the edge location.
Any thought whats happening? Thanks in advance.
https://d3ewqer4qpe.cloudfront.net/Sample.pdfand it resolved tohttps://eimages.s3.ap-northeast-2.amazonaws.com/Sample.pdf. As I don't have a pdf file in eimages it gives meAccessDenied. But if I use the correct URL which need to be redirectedhttps://epdfs.s3.ap-south-1.amazonaws.com/Sample.pdfit works as expected. So this should be an issue with the behavior resolution issue at CloudFront. - Erandacurl: (6) Couldn't resolve host 'd3ewqer4qpe.cloudfront.net'I can't bring this site up at all. Confirm that this is the correct hostname? - Michael - sqlbot