March 04, 2017 04:52PM
Hello,

Our local policy demands the rejection of any query; we do this as follows: if ($is_args) { return 301 /; }

The introduction of Thunderbird autoconfiguration demands an exception to the above policy, because of
"GET /.well-known/autoconfig/mail/config-v1.1.xml?emailaddre=uname%40example.com".

The resulting rule would be

if (($is_args) && ($args !~ emailaddress=.+%40[a-zA-Z0-9\.\-]+)) { return 301 /; }

The rule does not work, because nginx does not parse the AND condition.

Of course, you cannot just remove $is_args, because $args is usually empty.

The alternative would be if ($args ~ emailaddress=.+%40[a-zA-Z0-9\.\-]+)) { allow all; } else { return 301 /; },
but nginx does not parse if-then-else statements.

Are we stuck in the cage?
Subject Author Posted

conditional expression

173279834462 March 04, 2017 04:52PM

Re: conditional expression

webopsx March 04, 2017 10:08PM

Re: conditional expression

webopsx March 04, 2017 10:22PM

Re: conditional expression

173279834462 March 05, 2017 11:31AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 203
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