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

Support multiple trusted proxy ip addresses #3639

Merged
merged 2 commits into from Jun 8, 2017

Conversation

@nullkal
Copy link
Collaborator

commented Jun 8, 2017

It is often required to specify multiple trusted proxy IP addresses in the environment puma and nginx run in independent servers.

You can specify multiple trusted proxy IP addresses with this PR: TRUSTED_PROXY_IP=10.2.2.4 10.2.2.5

@@ -38,7 +38,7 @@
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

# Allow to specify public IP of reverse proxy if it's needed
config.action_dispatch.trusted_proxies = [IPAddr.new(ENV['TRUSTED_PROXY_IP'])] unless ENV['TRUSTED_PROXY_IP'].blank?
config.action_dispatch.trusted_proxies = ENV['TRUSTED_PROXY_IP'].split().map {|item| IPAddr.new(item) } unless ENV['TRUSTED_PROXY_IP'].blank?

This comment has been minimized.

Copy link
@Gargron

Gargron Jun 8, 2017

Member

split() is the same as split

Spacing between { |

@Gargron
Gargron approved these changes Jun 8, 2017
@Gargron Gargron merged commit b8ea28d into tootsuite:master Jun 8, 2017
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
codeclimate no new or fixed issues
Details
@nullkal nullkal deleted the multiple-trusted-proxy-ip branch Jun 8, 2017
koteitan added a commit to koteitan/mastodon that referenced this pull request Jun 25, 2017
* Support multiple trusted proxy ip addresses

* correct coding style
YaQ00 added a commit to YaQ00/mastodon that referenced this pull request Sep 5, 2017
* Support multiple trusted proxy ip addresses

* correct coding style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.