Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to use path style for bucket endpoint (instead of DNS) #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

toehio
Copy link

@toehio toehio commented Oct 29, 2015

This is especially useful when using a custom S3 endpoint. This comment says it all:
"Instead of using the DNS name of the bucket (e.g. BUCKET.s3.amazonaws.com) use the path style (e.g. s3.amazonaws.com/BUCKET/)".

This can be enabled when initializing the S3 object, or through the setter.

@kmichailg
Copy link

I think we need this. For (local) development and testing, I use https://github.com/jamhall/s3rver. Unfortunately, using the dns to access a bucket is quite troublesome as it is not set up automatically. I would have to add another proxy/reverse proxy in apache for it to work. So, I second this @tpyo 👍

@kmichailg
Copy link

Hi @tpyo, any updates on this? This is a much appreciated change. I've been using this fork for quite some time now. Didn't have any issues so far. Is there any security issue that I should be aware?

@alexstine
Copy link

@toehio Would this PR fix an error like this?

[02-Oct-2017 14:22:55 UTC] PHP Warning: S3::getBucket(): [PermanentRedirect] The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. in /wp-content/plugins/cloud-backups/classes/aws/s3.php on line 437

I need to access AWS with "bucket.s3.us-east-2.amazonaws.com" to get rid of this error I think. Would be nice to have this fixed so I can use whatever region instead of us-east-1 where /bucket/path/file.ext is still supported.

Thanks.

@toehio
Copy link
Author

toehio commented Nov 28, 2017

@tech55541 yes, I think this PR should fix that.

@kmichailg
Copy link

Hi @tpyo, long time user of this package. Recently returned here to find myself facing the same problem of using bucket endpoints instead of dns endpoints. Is there any problem with the solution proposed? I've abandoned using this fork since the master had updates I needed on a production build. Would be happy to help testing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants