amazon web services - For S3 site, how to configure S3, Route53, and Cloudfront to always use the root domain -
using route53, how can configure cloudfront enabled s3 site use root/naked domain?
take example, well, domain called example.com. first, know 1 needs create 2 buckets, www.example.com , example.com. beyond this, gets tricky when using cloudfront , route53.
figured out:
s3
- put contents of site in bucket example.com. note endpoint url. in case, it's example.com.s3-website-us-east-1.amazonaws.com.
- in properties example.com bucket, set 'enable web hosting'
- in properties www.example.com bucket, set 'redirect requests host name' , redirect requests to set example.com
cloudfront
create cloudfront distribution origin: example.com.s3-website-us-east-1.amazonaws.com (note, when using cloudfront, default origin options in picklist appeared example.com.s3.amazonaws.com, should example.com.s3-website-us-east-1.amazonaws.com. former standard east , should work, ran issues).
route53
for example.com hosted zone, create 2 dns records (should have ns , soa record if zone example on route53):
1
- type:
- name: (blank) - (therefore root/naked domain, example.com)
- alias: yes
- alias target: 'some cloudfront id'.cloudfront.net.
2
- type: cname
- name: www (therefore www.example.com)
- alias: no
- value: example.com.s3-website-us-east-1.amazonaws.com
Comments
Post a Comment