about summary refs log tree commit diff
diff options
context:
space:
mode:
authornullkal <nullkal@users.noreply.github.com>2017-06-08 21:33:28 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-06-08 14:33:28 +0200
commitb8ea28d6d0bd5701cf35d6f633b0aa36ceb5ca9c (patch)
treef257a3dd02b24f79968dce1bb821a469372b0f56
parentf741673638e11e53cd65c70dc5b266735357ad14 (diff)
Support multiple trusted proxy ip addresses (#3639)
* Support multiple trusted proxy ip addresses

* correct coding style
-rw-r--r--config/environments/production.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/config/environments/production.rb b/config/environments/production.rb
index f253ab5c7..bd87d79a7 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -38,7 +38,7 @@ Rails.application.configure do
   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.