0
votes

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:

  1. I created a CloudFront web distribution.
  2. I've setup an origin as secret.example.com (secret.example.com works normally on browser)
  3. I've added www.example.com as CNAME to my CloudFront distribution.
  4. 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?

1

1 Answers

0
votes

My apologies if you've already taken a look at the Amazon documentation regarding the subject, but I've once tested this solution and it worked fine for me:

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistS3AndCustomOrigins.html#concept_CustomOrigin

Take a look and see if you have missed a step (for example with the headers)