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.

已提问 1 个月前90 查看次数
3 回答
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
专家
Mike_L
已回答 1 个月前
profile picture
专家
已审核 25 天前
profile picture
专家
已审核 1 个月前
  • 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
已接受的回答

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

已回答 1 个月前
profile picture
专家
已审核 25 天前
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
已回答 1 个月前
  • 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...

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则