Rewriting Amazon S3 static urls [closed]

2019-07-15 14:16发布

In the interest of hosting purely static sites from Amazon S3, is the only route to rewrite the URLs and endpoints for accessing it's resources in a friendlier way via a rewrite engine such as any web server? And would it best to host this as an EC2?

It seems overkill but wasn't sure if there were alternatives.

2条回答
Summer. ? 凉城
2楼-- · 2019-07-15 14:34

I'm not sure why you need to rewrite.

You can assign a DNS CNAME to an S3 bucket for DNS. And they recently started supporting a default document.

So you can perfectly host http://www.example.com/ or http://www.example.com/some/path/to/some/file.html

http://aws.typepad.com/aws/2011/02/host-your-static-website-on-amazon-s3.html

查看更多
手持菜刀,她持情操
3楼-- · 2019-07-15 14:41

S3 offers no features to 'rewrite' URLs as keys are immutable.

If you want to use URLs that are different from the S3 key you'll have to proxy the requests yourself.

查看更多
登录 后发表回答