Amazon CloudFront Alternate Domain Names

醉酒当歌 提交于 2020-01-30 05:14:54

问题


I'm totally new to Amazon and all of its services. I have set up Amazon S3 and created a CloudFront distribution but what I want is to give a custom domain name to this CloudFront distribution.

I have created a sub-domain on my server and changed the CNAME to the CloudFront distribution link but I can not access to my content on S3. Can anyone tell me full go through how I can set up with alternate domain names?


回答1:


To give a custom domain name to an Amazon CloudFront distribution:

  • Provide an Alternate Domain Name when creating your CloudFront distribution
  • Create a CNAME record in Route 53 (or your own DNS provider) that points to the URL of your CloudFront distribution (eg d3i29vunzqzxrt.cloudfront.net), or create an A record in Route 53 that uses Alias = Yes and select the CloudFront distribution.

From the help tip in the CloudFront console:

If you want to use your own domain name (for example, www.example.com) instead of the CloudFront domain name (for example, d1234.cloudfront.net) for the URLs for your files, specify up to 100 CNAMEs. Separate CNAMEs with commas or put each on a new line. You also need to create a CNAME record with your DNS service to route queries for www.example.com to d1234.cloudfront.net.




回答2:


I think the guide is designed to have you spend more than you should. Instead, you should:

1 Add Alternate Domain Name as the guide says 2 Create "A" record in Route 53, not CNAME. AWS will charge you for each CNAME request.



来源:https://stackoverflow.com/questions/32549785/amazon-cloudfront-alternate-domain-names

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!