Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 have compiled nginx with mod_security support. In error log I can see the support for mod_security

2012/08/27 11:13:11 [info] 602096#0: ModSecurity for nginx/2.7.0-rc2 ( configured.

2012/08/27 11:13:11 [info] 602096#0: ModSecurity: APR compiled version="1.4.2"; loaded version="1.4.2"

2012/08/27 11:13:11 [info] 602096#0: ModSecurity: PCRE compiled version="8.2 "; loaded version="8.02 2010-03-19"

2012/08/27 11:13:11 [info] 602096#0: ModSecurity: Loaded PCRE do not match with compiled!

2012/08/27 11:13:11 [info] 602096#0: ModSecurity: LIBXML compiled version="2.7.8"

I have loaded the ModSecurityConfig and ModSecurityEnabled ModSecurityConfig /usr/local/nginx/conf/modsecurity/modsecurity_crs_41_sql_injection_attacks.conf; ModSecurityEnabled On;

But I cant make mod_security work.

Attacks can get through and I get no error in log file.

Do i need to add any extra configuration to enable mod_security for ngix?

Note: Im using nginx as reverse proxy


share|improve this question
up vote 1 down vote accepted

For those of you that may need a solution to this in the future:

I had to activate mod_security and I did this by adding "SecRuleEngine on" at the head modsecurity_crs_41_sql_injection_attacks.conf

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.