<div dir="ltr">Hi!<div><br></div><div>I'm using Nginx together with Naxsi; so not sure it this is the correct place for this post, but I'll give it a try.</div><div><br></div><div>I want to configure two detection thresholds: a strict detection threshold for 'far away countries', and a less-strict set</div><div>for local countries. I'm using a setup like:</div><div><br></div><div><div>location /strict/ {</div><div>     include /usr/local/nginx/naxsi.rules.strict;</div><div><br></div><div>     proxy_pass  <a href="http://app-server/">http://app-server/</a>;</div><div>}</div><div><br></div><div>location /not_so_strict/ {</div><div>     include /usr/local/nginx/naxsi.rules.not_so_strict;</div><div><br></div><div>     proxy_pass  <a href="http://app-server/">http://app-server/</a>;</div><div>}</div><div><br></div><div>location / {</div><div>     # REMOVED BUT THIS WORKS:</div><div>     # include /usr/local/nginx/naxsi.rules.not_so_strict;</div><div>     set $ruleSet "strict";</div><div>     if ( $geoip_country_code ~ (TRUSTED_CC_1|TRUSTED_CC_2TRUSTED_CC_3) ) {</div><div></div><div></div><div>        set $ruleSet "not_so_strict";</div><div>     }</div><div><br></div><div>     rewrite ^(.*)$ /$ruleSet$1 last;</div><div>}</div><div><br></div><div>location /RequestDenied {</div><div>    return 403;</div><div>}</div></div><div><br></div><div><br></div><div>The naxsi.rules.strict file contains the check rules:</div><div><div>CheckRule "$SQL >= 8" BLOCK;</div></div><div>etc.</div><div><br></div><div>For some reason this doesn't work. The syntax is ok, and I can reload Nginx. However the firewall never triggers. If I uncomment the include in the location-block / it works perfectly.</div><div>Any idea's why this doesn't work, or any better setup to use different rulesets based on some variables?</div><div><br></div><div>Thanks,</div><div><br></div><div>JP</div><div><br></div><div><br></div></div>