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

Specify the S3 bucket region #2

Merged
merged 3 commits into from
Sep 11, 2015
Merged

Specify the S3 bucket region #2

merged 3 commits into from
Sep 11, 2015

Conversation

rborer
Copy link
Contributor

@rborer rborer commented Sep 11, 2015

Hi,

While trying pinrepo (nice work btw), I had to modify a bit the requests sent to S3 as my bucket is not in the default region. Without those changes, each http request to pinrepo was getting a http 307 response from AWS.

For example I'm using eu-west-1 as the region.

Note that I couldn't test how it does react when the bucket is indeed in the default region.

This change is required if the bucket is not in the default region. Without it, each http request to pinrepo receives a http 307 response from AWS.
@@ -1,3 +1,5 @@
resolver 127.0.0.1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line related to the region changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is. As the hostname used in proxy_pass is no more static but dynamic, nginx needs to know which DNS resolver to connect to to do the resolution.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, of course. Thanks for clarifying!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't obvious to me too when I saw nginx complaining that it couldn't resolve the host ;-)

Btw, I forgot to mention that I tested this setup with Nginx 1.8.0. And I'm only using the maven repo, hopefully the other ones should work the same.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rborer for the fix, let me run some sanity check on other repos and the Nginx I have, and get back to you!

Reynald Borer added 2 commits September 11, 2015 22:11
In case the bucket contains a dot, the presented SSL certificate will be considered as invalid.
@rborer
Copy link
Contributor Author

rborer commented Sep 11, 2015

@sbaogang @jparise I've changed the host used in proxy_pass and added a few words about the region variable, let me know your thoughts.

@sbaogang
Copy link
Contributor

Looks good to me! Again, thanks a bunch for fixing this!

sbaogang added a commit that referenced this pull request Sep 11, 2015
Specify the S3 bucket region
@sbaogang sbaogang merged commit 32fc712 into pinterest:master Sep 11, 2015
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.

3 participants