<div dir="ltr">Hi,<div><br></div><div>I have updated the config to use 'map' instead of the if-statements. That's indeed a better way.</div><div>The problem however remains:</div><div><br></div><div>- Naxsi mainrules are in the http-block</div><div>- Config similar to:</div><div><br></div><div><div> map $geoip_country_code $ruleSetCC {</div><div> default "strict";</div><div> CC1 "relaxed";</div><div> CC2 "relaxed";</div><div> }</div><div><br></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 /relaxed/ {</div><div> include /usr/local/nginx/naxsi.rules.relaxed;</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> include /usr/local/nginx/naxsi.rules.default;</div><div><br></div><div> set $ruleSet $ruleSetCC;</div><div> rewrite ^(.*)$ /$ruleSet$1 last;</div><div> }</div></div><div><br></div><div><br></div><div>It's always using naxsi.rules.default. If this line is removed it's not using any rules (pass-all). </div><div><br></div><div>Thanks so far!</div><div><br></div><div>JP</div><div><br></div><div><br></div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 13, 2017 at 2:14 PM, Aziz Rozyev <span dir="ltr"><<a href="mailto:arozyev@nginx.com" target="_blank">arozyev@nginx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">At first glance config looks correct, so probably it’s something with naxi rulesets.<br>
Btw, why don’t you use maps?<br>
<br>
map $geoip_coutnry_code $strictness {<br>
default “strict";<br>
CC_1 “not-so-strict";<br>
CC_2 “not-so-strict";<br>
# .. more country codes;<br>
}<br>
<br>
# strict and not-so-strict locations<br>
<br>
map $strictness $path {<br>
"strict” "/strict/";<br>
"not-so-strict” "/not-so-strict/“;<br>
}<br>
<br>
location / {<br>
return 302 $path;<br>
# ..<br>
<span class="gmail-">}<br>
<br>
<br>
br,<br>
Aziz.<br>
<br>
<br>
<br>
<br>
<br>
> On 12 Nov 2017, at 14:03, Jean-Paul Hemelaar <<a href="mailto:hemelaar@desikkel.nl">hemelaar@desikkel.nl</a>> wrote:<br>
><br>
</span>> T THIS WORKS:<br>
> # include /usr/local/n<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a></div></div></blockquote></div><br></div></div>