https for S3 public website.

0

I try to add https-protocol to a S3 hosted static website through cloudfront.

To configure the origin, I choose the website-endpoint from the static hosting as Origin domain, but then a radio-select pops up below to choose the Protocol, either http-only, https-only or match viewer. My Problem is that https only and match viewer are disabled. I can't choose those options. Only http only is selectable. No tutorial mentions this disabled state. Certificate is correct in us-east-1 and selected for the cf-distribution. Any hint is welcome.

asked 13 days ago78 views
3 Answers
2

Instead of S3 hosted website through CloudFront, you can use CloudFront with OAC (Origin Access Control) to S3 bucket.

Disable hosted website and refer to How do I use my CloudFront distribution to restrict access to an Amazon S3 bucket? option 1

AWS
EXPERT
Mike_L
answered 13 days ago
profile picture
EXPERT
reviewed 8 days ago
profile picture
EXPERT
reviewed 13 days ago
  • no, that is not working. I restricted the access for s3 to only allow cloudfront AND disable the static hosting in s3... site was not accessible with https after deployment of the cloudfront settings.

1
Accepted Answer

I forgot to redirect route53 to cloudfront instead of the s3 bucket

answered 11 days ago
profile picture
EXPERT
reviewed 8 days ago
0

Hi, I would suggest verifying that S3 static website hosting is enabled on the S3 bucket, and you are providing manually the website endpoint URL instead of selecting the S3 REST API endpoint URL from the dropdown.

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistS3AndCustomOrigins.html#adding-cloudfront-to-s3

psp
answered 13 days ago
  • thanks for your hint, but I select the endpoint from the dropdown and enabled the website-hosting on the s3 bucket.

  • right - you would enter and provide the S3 website endpoint URL: http://bucket-name.s3-website-region.amazonaws.com instead of selecting from the drop down that chooses the S3 REST endpoint URL.

  • nope, tried that. Not working unfortunatly the https radio button remains disabled. If I use another url it works but that's not a solution...

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions