Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Host index.html in subfolders of S3 Bucket

static website hosting is working in the root directory but this is not working for me:

my.bucket/index.html
my.bucket/subfolder/index.html

https://s3-eu-west-1.amazonaws.com/my.bucket works as expected

https://s3-eu-west-1.amazonaws.com/my.bucket/subfolder doesn't work (Access Denied)

Is this possible?

like image 863
Alexej Haak Avatar asked Jun 22 '15 13:06

Alexej Haak


1 Answers

There are (at least) three ways to access a static website hosted in AWS.

  • The S3 bucket name
  • The CDN name. (which is what the "host a static website" wizard tells you to use)
  • The "Static website hosting endpoint" which is listed on the S3 bucket management page

Only the "static website hosting endpoint" filters incoming requests to give Apache like behaviour; S3 is a RESTful API for storing files with no concept of subfolders.

If you have used the wizard, there is "Manage file in S3" in tiny text at the bottom left of the screen, which will open up the correct page in the console for you, then click the 'properties' button.

like image 52
Chris Huang-Leaver Avatar answered Oct 04 '22 00:10

Chris Huang-Leaver