开发者

Mapping multiple subdomains to the same Amazon S3 bucket

开发者 https://www.devze.com 2023-02-27 03:53 出处:网络
I am aware of the procedure to map domains and su开发者_开发问答bdomains to S3 buckets, but my question is more related to DNS records. Can I have the static and cdn domains below pointing to the same

I am aware of the procedure to map domains and su开发者_开发问答bdomains to S3 buckets, but my question is more related to DNS records. Can I have the static and cdn domains below pointing to the same bucket through some sort of indirect DNS record? In other words, can static and cdn both point to an S3 record which then points to Amazon S3? So when I update where things point to, I only need to update the DNS record pointing directly to S3.

  • static.domain.com - points to my js,images,flash player, etc.
  • cdn.domain.com - points to video files on Amazon S3


No that's not possible as the CNAMES are linked to the bucket name.

You can use multiple CNAMES with Amazon's Cloudfront cdn.


You can use the same bucket to host both the static content and content served via the CDN.

What you have to do is,

  1. Make a bucket named static.domain.com and point your domian CNAME record accordingly.
  2. Created a clouldFront distribution of the bucket and add a CDN as a CNAME for the distribution
  3. Point the CDN CNAME for the distribution accordingly.

This way, when you refer to your bucket though the static.domain.com your files will be served through s3, and when you refer through cdn.domain.com your content would be served though the CDN.

0

精彩评论

暂无评论...
验证码 换一张
取 消