Virtual Host VS Path Style

Last Updated: Oct 17, 2018 05:34AM PDT

This article will give you a high-level explanation about virtual hosting
In general, virtual hosting is the practice of serving multiple websites or mini websites from a single web server. There are two major options to differentiate sites:
1.  Using a different path as part of the URI. Let's call it path style. 
2. Using different subdomain. Let's call it virtual hosting.

An ordinary Amazon S3 REST request specifies a bucket by using the first slash-delimited component of the Request-URI path.

Alternatively, you can use virtual hosting can be used to address a bucket in a REST API call by using the HTTP Host header. In practice, Amazon S3 interprets Host as meaning that most buckets are automatically accessible (for limited types of requests) at http://bucketname.s3.amazonaws.com.

Example Path Style Method

This example uses testbucket as the bucket name and test.jpg as the key name.

The URL is as follows:

http://s3.mypublicservice.com/testbucket/test.jpg

The request is as follows:

GET /testbucket/test.jpg HTTP/1.1
Host: s3.mypublicservice.com

Example Virtual Hosted–Style Method

This example uses testbucket as the bucket name and test.jpg as the key name.

The URL is as follows:

http://testbucket.s3.mypublicservice.com/test.jpg

The request is as follows:

GET /test.jpg HTTP/1.1
Host: testbucket.s3.mypublicservice.com

The virtual hosted–style method requires the bucket name to be DNS-compliant.

Part of the applications use only the virtual hosting approach and don't allow a configuration for path style, although the AWS SDK allows that. 
 
In order to achieve similar behavior with NooBaa, a virtual hosting must be configured in NooBaa.

Starting from V2.4.2, virtual hosting is enabled automatically after setting DNS name for your NooBaa system. Check https://noobaa.desk.com/customer/portal/articles/2866032-set-system-dns-name-​

Earlier versions require manual configuration, please contact support@noobaa.com.

The second and most important part is to register the DNS resolution of every bucket used by such applications. 

You can automate this process by creating a trigger for bucket creation that will run your code to provision this DNS resolution. 
 
Did you find this article helpful?
195e69fe2c7a9be6b2b2aa6b87f970548@noobaa.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete