Public S3 bucket (web server) returns 404

0

I have an S3 bucket configured as a public web server. When I visit the AWS generated URI for the bucket from a browser, the webpage shows up fine. However, I have a CNAME record in my DNS name server with a record <subdomain>.<mydomain>.com that points to this AWS generated URI. When the browser is visiting this subdomain URI, I get an error from S3 that says: 404 Not Found

Code: NoSuchBucket Message: The specified bucket does not exist BucketName: <my subdomain URI>

NRaj
已提問 1 年前檢視次數 531 次
1 個回答
0

Do the values in the CNAME record match the name of the S3 bucket?
For example, if the value of the CNAME record is "example.com", the name of the S3 bucket must also be "example.com".
https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#VirtualHostingCustomURLs

Your bucket name must be the same as the CNAME. For example, if you create a CNAME to map images.example.com to images.example.com.s3.us-east-1.amazonaws.com, both http://images.example.com/filename and http://images.example.com.s3.us-east-1.amazonaws.com/filename will be the same.

profile picture
專家
已回答 1 年前
profile picture
專家
已審閱 1 年前
profile picture
專家
已審閱 1 年前

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

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

回答問題指南