get_header("HTTP_AUTHORIZATION") end end throttle("token", limit: 5000, period: 1.hour) do |req| req.token_string end throttle("subdomain", limit: 50000, period: 1.minute) do |req| req.host end end SmartHRで動いているコードを発表用に加工しています config/initializers/rack_attack.rb