Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CloudFront Custom domain name with HTTPS not working

1.I have a domain purchased through godaddy. I have set custom DNS and added 4 name servers generated by the hosted zone in AWS Route 53. DNS lookup through whois.net shows the correct values.

2.In Route 53, I have added an A record to the Alias Target xxxxxxxxxxxxxx.cloudfront.net. So the traffic hits Route 53 and goes to CloudFront.

3.In CloudFront, I have one distribution. As Alternate Domain Names (CNAMEs), I have the following values: *.domain.com / www.domain.com / domain.com Under origins, I have one record with the following Origin Domain Name: domain.com.s3-website.az-name-1.amazonaws.com

4.I am hosting website in an S3 bucket. All HTTP requests are set to redirect to HTTPS.

5.Lastly, I have created (US East (N. Virginia) region) and verified a single certificate for the following domain names: domain.com, www.domain.com, *.domain.com I have read some answers that I should just wait and the custom SSL certificate option will become enabled. It's been more than day now, however, and there is no sign of that happening.

My website works in http mode, but not in https url. Any solution ...Please help... PS. I am new to aws, please help me...

like image 334
R23 Avatar asked Dec 14 '17 07:12

R23


2 Answers

HTTPS settings was working perfectly as cloudfront url was working as expected so I realized it was just a DNS issue. All it took was an TYPE A record pointing to it.

Solution : Add/edit proper "TYPE A" record with "Alias Target" as a cloudfront url.

Credit : Setup AWS S3 static website hosting using SSL (ACM)

like image 149
R23 Avatar answered Sep 28 '22 06:09

R23


Can you confirm whether you have used ACM to generate the SSL certificate? Or you are using SSL certificate from other vendors?

STEP 1: If you have generated the SSL Certificate from ACM, please make sure you did that with US East (N. Virginia) region. Because, CloudFront being an AWS service which is not tied to any specific region, it will use the certificates from US East region only.

STEP 2: 1. Use the "Request or Import a certificate" option in CloudFront 2. Select the certificate which you generated 3. Complete the setup and try

If everything else is setup fine, you should be able to access the contents with HTTPS after the above step.

Let me know in case it didn't work

like image 40
Nans Avatar answered Sep 28 '22 06:09

Nans