Poste novamente comentário de Pothi como CW
If não é mal , se usado fora de um bloco location ! Mesmo dentro de um bloco location , ele pode ser usado com as diretivas return e rewrite !
Snippet da página IfIsEvil
Directive
ifhas problems when used inlocationcontext, in some cases it doesn't do what you expect but something completely different instead. In some cases it even segfaults. It's generally a good idea to avoid it if possible.The only 100% safe things which may be done inside if in
locationcontext are:return ...; rewrite ... last;Anything else may possibly cause unpredictable behaviour, including potential SIGSEGV.