Problem/Motivation
According to the Amazon S3 documentation:
Amazon S3 supports both virtual-hosted–style and path-style URLs to access a bucket.
In a virtual-hosted–style URL, the bucket name is part of the domain name in the URL. For example:
http://bucket.s3.amazonaws.com
http://bucket.s3-aws-region.amazonaws.com.
In a virtual-hosted–style URL, you can use either of these endpoints. If you make a request to the http://bucket.s3.amazonaws.com endpoint, the DNS has sufficient information to route your request directly to the Region where your bucket resides.
For more information, see Virtual Hosting of Buckets.
In a path-style URL, the bucket name is not part of the domain (unless you use a Region-specific endpoint). For example:
US East (N. Virginia) Region endpoint, http://s3.amazonaws.com/bucket
Region-specific endpoint, http://s3-aws-region.amazonaws.com/bucket
In a path-style URL, the endpoint you use must match the Region in which the bucket resides. For example, if your bucket is in the South America (São Paulo) Region, you must use the http://s3-sa-east-1.amazonaws.com/bucket endpoint. If your bucket is in the US East (N. Virginia) Region, you must use the http://s3.amazonaws.com/bucket endpoint.
Currently, the S3 File System module only allows virtual-hosted-style endpoints. Some non-Amazon S3 implementations only support path-style endpoints, so it would be useful to allow that option to be selected by site administrators.
Proposed resolution
Add a checkbox for using a path-style endpoint to the settings administration page and include that setting when instantiating an S3 client.
Remaining tasks
- Add a "Use path-style endpoint" checkbox to the administration form
- Include the "Use path-style endpoint" setting when an S3 client is instantiated
- Add the "Use path-style endpoint" setting to the configuration form test
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3022288-10--s3fs--use-path-style-endpoint.patch | 1.06 KB | douggreen |
| #3 | 3022288-3.patch | 3.54 KB | rlhawk |
Comments
Comment #2
rlhawkComment #3
rlhawkHere's a patch that adds the ability to use a path-style endpoint.
Comment #4
francescoben commentedHi rlhawk,
I have to use path style endpoints when using Minio for local development and I can confirm this patch is working very well, do you have any updates on its integration?
Thanks
Comment #5
rlhawkHi francescoben. If it works well for you and there aren't any concerns with the code, you can change the status of this issue to RTBC, which should improve the patch's chance of getting committed. It's working well for my use case also.
Comment #6
douggreen commented+1, wfm
Comment #8
jansete commentedAdded to dev branch.
Thanks!
Comment #10
douggreen commentedBackport for Drupal 7