7
votes

I run an ad server that serves several static files like "ads.js". Using cloudfront and an s3 bucket, you can access this file like:

http://bucket.mydomain.com/assets/ads.js

I have hundreds of clients, and many of them would like to use their own mirror domain to serve the assets:

http://bucket.theirdomain.com/assets/ads.js

This works by making a CNAME alias DNS record that points bucket.theirdomain.com to bucket.mydomain.com.

However, I have to add each domain manually in Amazon AWS Cloudfront settings. There is an Alternate Domain Names (CNAMEs) section that I have to add *.theirdomain.com for every client that wants to do this.

Is there a way to allow all domains? Or should I make some sort of re-routing script? If the DNS skipped cloudfront and went directly to the bucket, I would be fine with that. Right now I get "ERROR: The request could not be satisfied." until I whitelist the domain for cloudfront.

1
do you found any solutions fo it? - Nitin Goyal

1 Answers

0
votes

You have to use Alternate Domain Names (CNAMEs) : *.example.com

as same certifcate have to use *.example.com

You cant use cloudfront default cerfificate.