Binary logic in "if" directive

Igor Katson descentspb at gmail.com
Fri Oct 23 14:54:06 MSD 2009


Maxim Dounin wrote:
> Hello!
> 
> On Thu, Oct 22, 2009 at 04:04:32PM +0400, Igor Katson wrote:
> 
>> Is it possible to combine several conditions in the if directive, like
>>
>> condition1 AND condition2 OR condition3
>>
>> ?
>>
>> Or at least just condition1 AND condition2?
> 
> No.
> 
> Workaround is to use set + regex checks in if, e.g.
> 
>     set $blah "$arg_a:$arg_b";
> 
>     if ($blah ~ ^a:b$) {
>         ...
>     }
> 
> Note though that if is evil.  Search list archives for details.

> 
> Maxim Dounin
> 
Thanks! That workaround works ok.





More information about the nginx mailing list