Skip to content

Instantly share code, notes, and snippets.

@dpaluy
Created June 28, 2018 20:01
Show Gist options
  • Select an option

  • Save dpaluy/8ef113476ff379fbc0a2dd4bbf08ce75 to your computer and use it in GitHub Desktop.

Select an option

Save dpaluy/8ef113476ff379fbc0a2dd4bbf08ce75 to your computer and use it in GitHub Desktop.
ignore PHP bots
class Rack::Attack
Rack::Attack.blocklist('bad-robots') do |req|
req.ip if /\S+\.php/.match?(req.path)
end
end if Rail.env.production?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment