Welcome! Log In Create A New Profile

Advanced

Different Naxsi rulesets

November 12, 2017 06:06AM
Hi!

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.

I want to configure two detection thresholds: a strict detection threshold
for 'far away countries', and a less-strict set
for local countries. I'm using a setup like:

location /strict/ {
include /usr/local/nginx/naxsi.rules.strict;

proxy_pass http://app-server/;
}

location /not_so_strict/ {
include /usr/local/nginx/naxsi.rules.not_so_strict;

proxy_pass http://app-server/;
}

location / {
# REMOVED BUT THIS WORKS:
# include /usr/local/nginx/naxsi.rules.not_so_strict;
set $ruleSet "strict";
if ( $geoip_country_code ~ (TRUSTED_CC_1|TRUSTED_CC_2TRUSTED_CC_3) ) {
set $ruleSet "not_so_strict";
}

rewrite ^(.*)$ /$ruleSet$1 last;
}

location /RequestDenied {
return 403;
}


The naxsi.rules.strict file contains the check rules:
CheckRule "$SQL >= 8" BLOCK;
etc.

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.
Any idea's why this doesn't work, or any better setup to use different
rulesets based on some variables?

Thanks,

JP
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Different Naxsi rulesets

jeanpaul November 12, 2017 06:06AM

Re: Different Naxsi rulesets

Aziz Rozyev November 12, 2017 08:36AM

Re: Different Naxsi rulesets

jeanpaul November 12, 2017 09:18AM

Re: Different Naxsi rulesets

Aziz Rozyev November 13, 2017 08:16AM

Re: Different Naxsi rulesets

jeanpaul November 13, 2017 01:48PM

Re: Different Naxsi rulesets

Aziz Rozyev November 13, 2017 02:32PM

Re: Different Naxsi rulesets

jeanpaul November 15, 2017 01:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 81
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready