I think I have S3, Cloudfront and Route 53 configured correctly, but when I try to reach my custom domain ‘blog.example.com’ it says ‘server not found’.
I have a S3 bucket which is public and has ‘static website hosting’ enabled. I can reach the bucket on the ‘http://blog.example.com.s3-website-us-east-1.amazonaws.com’ and see my site.
I have a Cloudfront distribution with an AWS certificate issued to ‘blog.example.com’ and I can see a ‘distribution domain name’ in Cloudfront, it looks like ‘[numbers & letters].cloudfront.net’. When I got to https://[numbers & letters].cloudfront.net’ I can see my site but if I go to ‘blog.example.com’ I get ‘server not found’ and I don’t understand why not.
My guess is that there’s nothing pointing blog.example.com at either the https or the http sites but I simply don’t understand how to make the connection. I’ve read a lot of different guides but only end up going around in circles.
Help gratefully received.
2
Answers
I tried to follow the answers I received above, from @theherk but they did not solve the problem for me. However, I did find a solution that works for me. I deleted my hosted zone from Route 53 and immediately I could access my site at https://blog.example.com
You’re missing two things, it seems.
How you add the CNAME depends on your DNS, but if you’re using Route53, the same instructions, Using custom URLs by adding alternate domain names (CNAMEs) will help you with both steps.
For the Alternate Domain Name in Cloudfront, you just edit your Distribution and update the value
Alternate Domain Names (CNAMEs)
.