Skip to content

Instantly share code, notes, and snippets.

View sergeylanzman's full-sized avatar

Sergey Lanzman sergeylanzman

View GitHub Profile
@sergeylanzman
sergeylanzman / application.rb
Created April 30, 2017 08:19 — forked from mattheworiordan/application.rb
CloudFlare IP Middleware for Rails to ensure HTTP_CF_CONNECTING_IP is used and the clients IP is correct within Rails
module RailsAppName
class Application < Rails::Application
# .... your settings
require "#{Rails.root}/lib/cloud_flare_middleware"
config.middleware.insert_before(0, Rack::CloudFlareMiddleware)
# ... your settings
end
end