You can use the Rack middleware from the remote_ip_proxy_scrubber bug to make sure your Rails application ignores IP addresses from trusted proxies such as CloudFlare.
First add the gem to your gemfile and then bundle install
gem 'remote_ip_proxy_scrubber'
IP- CloudFlare: https://www.cloudflare.com/ips-v4
IP- CloudFlare, config/application.rb conifg/environment/*. rb
config.middleware.insert_before(Rails::Rack::Logger,
RemoteIpProxyScrubber.filter_middleware,
%w{
199.27.128.0/21
173.245.48.0/20
103.21.244.0/22
103.22.200.0/22
103.31.4.0/22
141.101.64.0/18
108.162.192.0/18
190.93.240.0/20
188.114.96.0/20
197.234.240.0/22
198.41.128.0/17
162.158.0.0/15
104.16.0.0/12
172.64.0.0/13
})
config.middleware.insert_before(Rails::Rack::Logger, RemoteIpProxyScrubber.patched_logger)
config.middleware.delete(Rails::Rack::Logger)
IP- CloudFlare .
- CloudFlare, CloudFlare IP- .
- IFTTT, , CloudFlare IP-.