Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a way to get my nginx to have reasonable abilities for auto-blocking various malicious requests.

E.g. since it doesn't serve any php scripts, any request for a php URLs that script kiddies seem to direct to my server should result in an immediate (temporary) ban of that IP.

share|improve this question
up vote 3 down vote accepted

update, mod_security now available for nginx:

share|improve this answer

You can try fail2ban. It scans log files and can update firewall rules to ban specific IP. Also, it can execute any other action if needed.

share|improve this answer

As far as I know Naxsi is the only web application firewall solution for Nginx at the moment. It does not rely on signatures, but instead it detects unexpected characters in the HTTP communication. It also comes with a learning daemon that can be used to generate profiles for your applications.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.