Rewriting Amazon S3 static urls [closed]

只愿长相守 提交于 2019-12-11 03:17:09

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/5236472/rewriting-amazon-s3-static-urls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!