> Yes, separate normal locations or nested ones is
> the way to go.
>
> Maxim Dounin
I read documentation for further details and that's what i found:
if: "Checks the truth of a condition. If the condition evaluates to true, then the code indicated in the curly braces is carried out and the request is processed in accordance with [b]the configuration within[/b] the following block."
location: "While nested locations are allowed by the configuration file parser, their use is [b]discouraged[/b] and may produce unexpected results."
http://wiki.nginx.org/NginxHttpRewriteModule#if In examples we can clearly see that it is used with proxy_pass, which is similar fastcgi_pass.
I'll add the break, but as I said try passing JPG files to fastcgi - this seams to be a problem in my case. Because in some cases fastcgi_pass was the last if() in location and still it led to the crash.