Skip to content

Commit

Permalink
Support multiple trusted proxy ip addresses (#3639)
Browse files Browse the repository at this point in the history
* Support multiple trusted proxy ip addresses

* correct coding style
  • Loading branch information
nullkal authored and Gargron committed Jun 8, 2017
1 parent f741673 commit b8ea28d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?

# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
Expand Down

0 comments on commit b8ea28d

Please sign in to comment.