I have a cloud front app with domain xyz123.cloudfront.net
.
This CloudFront is then mapped to domain sub1.mydomain.com
. For this, I followed these steps.
*.mydomain.com
A
Alias
record in Route 53 to xyz123.cloudfront.net
This makes sub1.mydomain.com
work perfectly over SSL.
Now, I want to allow my users to use their own domain (eg sub1.userdomain.com
) to access the app.
This is similar to what UptimeRobot allows in its public status pages.
What I tried, but not working
CNAME
to sub1.userdomain.com
pointing to xyz123.cloudfront.net
, I get SSL ErrorCNAME
to sub1.userdomain.com
pointing to sub1.mydomain.com
, I get SSL ErrorCNAME
to sub1.userdomain.com
pointing to xyz123.s3-website.ap-south-1.amazonaws.com
(S3 Static Hosting URL)Question
Unfortunately, there is no way to add more than 10 custom domains to a SSL in AWS. Which is a prerequisite to having a custom domain to your cloudfront.
Hence, a workaround this could be as below. 1. Create a S3 single bucket which hosts your code 2. Create Multiple Could front distributions connected to single S3 Bucket 3. Then, add custom domains to these cloud front.
You will also need to think about CORS settings in your API of the app to allow requests from these custom domains.