More than one conditon in an IF statement?

eliott eliott at cactuswax.net
Sat Feb 2 00:19:29 MSK 2008


On 2/1/08, Ian Neubert <lists at ruby-forum.com> wrote:
> Hello All,
>
> I can't seem to figure out how to put more than on condition in an IF
> statement. Is this possible?
>
> I thought this would work:
> if ($request_uri ~* \.(jpg|jpeg|gif|png|css)$) {
>   expires 1d;
> }
> if ($is_args) {
>   expires max;
>   break;
> }
>
> But it sets all URI's with a query string to expire max, instead of just
> those ending in (jpg|jpeg|gif|png|css).
>
> Any ideas? Thanks in advance for your help.

you could either adjust your if statement logic, or set a variable in
the first if, and test for it later.





More information about the nginx mailing list