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

Comments

rlhawk created an issue. See original summary.

rlhawk’s picture

Issue summary: View changes
rlhawk’s picture

Status: Active » Needs review
StatusFileSize
new3.54 KB

Here's a patch that adds the ability to use a path-style endpoint.

francescoben’s picture

Hi 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

rlhawk’s picture

Hi 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.

douggreen’s picture

Status: Needs review » Reviewed & tested by the community

+1, wfm

  • jansete committed eb82e19 on 8.x-3.x authored by rlhawk
    Issue #3022288 by rlhawk, francescoben, douggreen: Support path-style...
jansete’s picture

Status: Reviewed & tested by the community » Fixed

Added to dev branch.

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

douggreen’s picture

Backport for Drupal 7