Reputation: 1075
I use route 53 as my dns serever
then I have a A record in my route 53 records called
image.mysite.com. A 111.222.333.444
then I want to use CloudFront as my cdn to caching images then I added new Distributions and removed the A record added cname:
image.mysite.com. CNAME d23456.cloudfront.net
but when I visit my website image.mysite.com it show
Sorry, invalid request
and when i trying to visit d23456.cloudfront.net directly it displayed:
ERROR
Failed to contact the origin.
how can I successfully use CloudFront as image.mysite.com CDN and use route 53 as dns server?
Upvotes: 1
Views: 3281
Reputation: 11596
From your comment it seems that you point CloudFront to the origin server images.mysite.com
which actually points back to CloudFront so CloudFront doesn't know how to access your site.
Create another DNS record (e.g. origin.mysite.com. IN A 111.222.333.444
) and point CloudFront to it. After that CloudFront would respond to requests to images.mysite.com
with data from origin.mysite.com
.
Upvotes: 3