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.

전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인