Hari Seldon
Hari Seldon

Reputation: 1060

How is it I am hosting through s3.amazonaws.com

I created a static website mockup for a friend and decided to put it up on my s3 account for a temporary hosting spot. So I uploaded the site files and made them public.

I was surprised to learn that I can access the site via (actual path redacted, but example illustrates point):

https://s3.amazonaws.com/my/s3/path/to/file.html

How is this possible? I expected to have some sort of identifier in the url, referencing my account, but clearly this is not the case.

Can someone explain how amazon does this?

Upvotes: 1

Views: 124

Answers (1)

gview
gview

Reputation: 15361

Access to s3 can be secured in a variety of ways, but frequently people want to host these files directly out of s3, so they provide public access. You must have setup access to your bucket/objects so that they are public.

You can also set the bucket name to be a domain of your choosing ala files.yourdomain.com, add a CNAME pointing to s3, and they will automatically determine that the files should come from your public bucket, using a little bit of internal rewriting.

Upvotes: 1

Related Questions