I have a website installed and working correctly on my EC2 instance. I want to setup CloudFront and use it as a front CDN service just like CloudFlare. (My old stack was like that; I was able to serve the whole website through CloudFlare just by adding proper DNS records)
Here is what I did:
- I created a CloudFront web distribution.
- I've setup an origin as secret.example.com (secret.example.com works normally on browser)
- I've added www.example.com as CNAME to my CloudFront distribution.
- I've set a CNAME record to point www subdomin to my CloudFront's distribution domain.
Here is what happens: I can't connect to my website through CloudFront distribution's domain. Thus, www.example.com doesn't work.
What did I do wrong?