1

I'm planning offloading assets to Amazon S3 with Amazon Cloudfront on top of that. I'm planning on registered a new domain name for that. Now I wonder whether I can tie a subdomain to Amazon Cloudfront, while pointing other subdomains to another server, as follows:

https://assets.example.com > Cloudfront

https://www.example.com > Another server

Additionally, would it be significantly easier to set this up through Amazon Route 53 in combination with Amazon Certificate Manager for the above purpose?

1 Answer 1

1

Subdomains are treated as completely separate domain names, so you can certainly point them to different destinations.

Alternatively, you could use one domain name but configure Amazon CloudFront to point to different origins (eg S3 and a Load Balancer) based upon the path used, eg:

  • example.com --> Load Balancer
  • example.com/images --> Amazon S3 bucket

I note that you are intending to use HTTPS. A few things to note:

  • Pointing directly to an Amazon S3 bucket with your own domain name will not work with HTTPS
  • Amazon CloudFront can support HTTPS via:
    • xxx.cloudfront.net = Free
    • Using Server Name Indication (SNI) = Free, but does not work with some browsers/Operating Systems
    • Custom Domain Name = $600/month

See: Using HTTPS with CloudFront and Amazon CloudFront Custom SSL

2
  • Can you elaborate why this isn't possible? "Pointing directly to an Amazon S3 bucket with your own domain name will not work with HTTP"?
    – bart
    Feb 18, 2017 at 1:20
  • Your domain name will resolve to the IP address of an Amazon S3 server. The servers are shared for many users and many buckets, so it is not an unique IP address just for your bucket. Therefore, S3 doesn't know which bucket you want. This can be resolved by naming your bucket the same as the domain name (eg my-bucket.example.com). However, this is not supported under HTTPS because it would require your certificate to be installed on the Amazon S3 servers, with those servers dedicated to your use. (Similar to CloudFront, for which they give the above-listed options.) Feb 18, 2017 at 1:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.