Cloudfront distribution for S3 Public Website - custom origin not working but S3 origin working ? Why ?

0

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/GettingStarted.SimpleDistribution.htmlI was trying this exercise in my account : I configured a public S3 bucket as static website and hosted website by uploading the Helloworld files Worked well Enter image description here
Enter image description here

Next step I wanted to create a cloud front distribution with Custom S3 origin as shown was selected. Other settings left default. Selected website S3 endpoint as shown while selecting the bucket as shown in figure Enter image description here

The resultant cloudfront distribution is giving Error as follows : Enter image description here

Step : 2 Created other Cloudfront Distribution with S3 origin and this worked fine as follows Why ? Enter image description here

WHY This difference in Distribution hosted from S3 and Custom Origin

PFA the two cloudfront distribution : Enter image description here

1 個回答
1

When you choose a custom origin you're accessing some arbitrary website by URL. So you need to provide a website URL like in your first image, with "s3-website" in it. The "origin domain" you provided as shown in your second image is not pointing to the S3 bucket's static website.

When you use an S3 origin you're not accessing the bucket's static website, you're accessing its REST interface. You could (and should!) disable the static website and make the bucket non-public, and this will stll work via the Origin Access Identity.

專家
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南