0
votes

Here's my setup:

  • S3 Bucket for static website. Site generated by GatsbyJS
  • CloudFront Distribution
  • Configured CloudFront alternate domain names for mydomain.com and www.mydomain.com
  • Attached SSL (from AWS Cert Manager) to my CloudFront distribution for mydomain.com and www.mydomain.com
  • Route53: A record mydomain.com to CloudFront domain
  • Route53: CName record www.mydomain.com to mydomain.com

Here's what I am experiencing

  • mydomain.com: https good on Chrome, not on Firefox or Edge
  • www.mydomain.com: no https for Chrome, Firefox, or Edge

I'm sure I am doing something wrong with configuration with the 'www' part. The weirdest one is the Chrome vs the other browsers not recognizing the HTTPS

1
somewhat depends on what the SSL was certified for and whether or not the CA that certified it is in the trusted CA authority list for Firefox and Edge.ewong
where did you get the ssl certificate. you can get one from AWS ACM for free. also i believe you created an A record as an Alias and point it to cloudfrontArun K
What do you mean by sees HTTPS? If you go to the HTTPS version of your domain it doesn't work on those browsers?Chris Williams
amazon ssl certificate should not have any trust issues. could be a browser cache issue. can you try from a different computerArun K
@ArunK, tried on my phone (chrome, Firefox, and Duckduckgo). Chrome recognized SSL. Same goes for another PC. However, I then manually typed "https://" instead of just mydomain.com, SSL did work. For some reason, requests aren't automatically changing from http to httpsErvin E

1 Answers

3
votes

Did you try setting ViewerProtocolPolicy to 'redirect-to-https' under DefaultCacheBehavior on the Cloudfront distribution?

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html