Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon s3 bucket dumps entire content in XML upon visiting index

Tags:

So something weird happened, I've set up my AWS S3 bucket for static website hosting, and it all works perfectly fine, but whenever I go to plain domain (For example: 'test.com') It returns an XML file error, followed by dumping all the content in that XML. It'll look like this, but the rest of the domains like 'test.com/test' does work.. I have index.html set as my index in my bucket, and everything seems to be properly configured. Any help?

Also, going to 'test.com/index' does in fact show the index fine, only when you go to 'test.com' does it give the XML error.

like image 977
TomatoMan Avatar asked Oct 18 '17 20:10

TomatoMan


1 Answers

You have two problems:

  • You've misconfigured the bucket ACL or policy to allow everyone to list the objects in the bucket.

How do you list the objects in a bucket? You go to the root of the REST endpoint of the bucket... so what you're seeing is not an XML "error" -- it's a bucket listing.

This, in turn, reveals the second problem:

  • You've configured your domain to point to the REST endpoint, not the web site hosting endpoint.

The web site hosting features are only available from the web site endpoints.

http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteEndpoints.html

like image 74
Michael - sqlbot Avatar answered Oct 13 '22 09:10

Michael - sqlbot