AWS Certified Solutions Architect - Professional 2020

Sign Up Free or Log In to participate!

Setting up Amazon cloudfront with EC2 origin with custom domain name hosted on route53

Can you guys help me out in identifying what I am doing wrong in setting up the cloudfront for my ec2 instance (web server) for a custom domain of mine.

I am using my domain name (www.example.com) as the origin domain name.

I have also supplied a certificate to the cloudfront (*.example.com) using ACM.

The problem I am facing is, when i point out my custom domain name to the cloud fronts domain name in route53 using an alias record.

My website responds with an error 502. I’ll really appreciate any help. I have explored all the content provided by AWS in respect to this but nothing seems to work till now.

Tom Kringstad

Hi Chetan, you mention you’ve explored all content provided by AWS – does that include the various troubleshooting steps in the following article? https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-502-bad-gateway.html

2 Answers

Hi Chetan,

As Tom says, there can be multiple things at play here.   One might even be not giving CloudFront enough time to deploy…this can sometimes take 30 minutes or more.  The troubleshooting tips Tom provides above would be a good first start.

–Scott

If you are using EC2 as origin, you cannot use certificate provided by AWS Certificate Manager (ACM), you must use a certificate that is signed by a trusted third-party certificate authority (CA)

Please check this link

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-cloudfront-to-custom-origin.html

Y

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?