about location

Igor Sysoev igor at sysoev.ru
Fri Apr 16 09:25:44 MSD 2010


On Fri, Apr 16, 2010 at 11:05:59AM +0800, 李睿 wrote:

> Can i use this sentence in location ?
> 
>             if ($request_uri ~* "^/(list|small|big)_.*") {
>                 expires      1m;
>             }

You should use just location:

       location ~* "^/(list|small|big)_.*") {
            expires      1m;
       }

or better several static prefix locations:

       location /list_ {
            expires      1m;
       }

       location /small_ {
            expires      1m;
       }

       location /big_ {
            expires      1m;
       }


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list