about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2022-04-19 16:11:58 +0900
committerGitHub <noreply@github.com>2022-04-19 08:11:58 +0100
commit5781d1db841ff7f81301cd28acecc5331a68d97e (patch)
tree2fdbc4c084b0786c3e87f0ac14ddb6190a23966a /config
parent50a088fd77d46110776789e13ec8eb27188f5f9d (diff)
Fix parsing `TRUSTED_PROXY_IP` (#18051)
Diffstat (limited to 'config')
-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 95f8a6f32..514c08cff 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -42,7 +42,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 = ENV['TRUSTED_PROXY_IP'].split.map { |item| IPAddr.new(item) } if ENV['TRUSTED_PROXY_IP'].present?
+  config.action_dispatch.trusted_proxies = ENV['TRUSTED_PROXY_IP'].split(/(?:\s*,\s*|\s+)/).map { |item| IPAddr.new(item) } if ENV['TRUSTED_PROXY_IP'].present?
 
   config.force_ssl = true
   config.ssl_options = {