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
asked 10 months ago469 views
1 Answer
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
EXPERT
answered 10 months ago
profile picture
EXPERT
reviewed 10 months ago
profile picture
EXPERT
reviewed 10 months ago

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