adding a subdomain to route 53 with cloudfront
I have an Lightsail server that I would like to use to host multiple websites. I've set up a virtual host on apache to do this, and I have verified that it works by adding the server IP address as an A record for that subdomain. However, what I would like to do is have everything run through the Cloudfront CDN just as the main domain is currently. So I have dathlab.link set up, and would like to get testing.dathlab.link running. I removed the A record. What do I need to adjust in order to make this work? I am guessing my DNS settings in Route 53 need to be changed, but how?
Assuming the subdomains are serving up different content, you will need to create a CloudFront distribution for each subdomain and then in Route 53 use an Alias in the subdomain record to point to the distribution.
What ended up working was to keep my single CloudFront distribution and single server, then have Route 53 CNAMEs for each subdomain I set up via the TLS/SSL cert system. Also as a note, the virtual host does not need an https config on the server, likely because the CloudFront TLS system removes that necessity
Relevant questions
How to set Cloudfront custom headers
Accepted Answerasked 2 years agoUsing Lightsail with Cloudfront
asked 2 years agoHow to connect a Lightsail instance to AWS CloudFront?
asked 5 years agoHost S3 website with on-premises DNS server without Route53
Accepted Answerasked 2 months agoMultiple Regions behind Load Balancer - how is traffic distributed?
asked 5 years agocan I set up DNS to route requests to an alternate subdomain with EC2?
asked 2 years agoStatic Website S3 not resolving - DNS Provider is not AWS
asked 10 months agoadding a subdomain to route 53 with cloudfront
asked 3 months agoCloudFront: InvalidHeadersForS3OriginException in Edit Behavior
asked a year agoDNS Server Settings to point to EC2 Instance for existing Domain
Accepted Answerasked 2 years ago