1

I'm trying to set up AWS to serve a static S3 site over SSL with a custom domain. I'm so close but I'm missing one piece.

S3 static website (works): xyz.s3-website.us-east-2.amazonaws.com

CloudFront distribution: abc.cloudfront.net w/SSL cert from Certificate Manager for mydomain.com with behavior of Redirect HTTP to HTTPS

DNS (GoDaddy): CNAME www abc.cloudfront.net

The cert is set up for both www and none.

What am I doing wrong?

  • have you checked binding settings ? – Aravinda Mar 23 at 0:49
  • @Aravinda Can you be more specific please? – TrueWill Mar 23 at 17:46
  • what is the websrver used ? – Aravinda Mar 24 at 2:56
  • @Aravinda There is no web server. This is hosting static files directly from an S3 bucket. – TrueWill Mar 24 at 19:15
1

You need to create another CloudFront Distribution and another S3 Bucket (www-bucket). You can use your current SSL certificate since you mentioned it's valid for both none and www

Read about redirecting from your www-bucket to the main bucket - How Do I Redirect Requests to an S3 Bucket Hosted Website to Another Host?

You can use this CloudFormation template cloudformation-s3-website-ssl-with-redirect to implement this solution.

You can also read this nice blog post - How to do Site redirection using AWS S3?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.