Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is difference between aws s3 virtual-hosted–style URL V/s path-style URL

AWS S3 provides 2 styles of paths for accessing S3 objects. Are there any reasons for which style should be used when?

In a virtual-hosted–style:
http://bucket.s3.amazonaws.com
http://bucket.s3-aws-region.amazonaws.com.


In a path-style URL : 
http://s3.amazonaws.com/bucket
http://s3-aws-region.amazonaws.com/bucket
like image 283
ExploringApple Avatar asked Jan 30 '23 01:01

ExploringApple


1 Answers

There's quite a bit of information regarding this in the Virtual Hosting of Buckets section of the AWS docs.

Besides the attractiveness of customized URLs, a second benefit of virtual hosting is the ability to publish to the "root directory" of your bucket's virtual server. This ability can be important because many existing applications search for files in this standard location. For example, favicon.ico, robots.txt, crossdomain.xml are all expected to be found at the root.

In short, when using the virtual hosted style you will have your files at the root directory. This means you are accessing the top level of what is basically a file structure for your domain which is handy when dealing with some applications that will search your domain at this root level for certain things such as a favicon (the little icon on the tab of the page in your browser).

Other advantages include generally having a neater looking domain. This is almost always the better option when it comes to domains unless you simply want your bucket for personal use where most of this wouldn't matter.

like image 52
Ciaran Lyne Avatar answered Feb 03 '23 23:02

Ciaran Lyne