Conflicting location blocks...

Igor Sysoev is at rambler-co.ru
Tue Sep 16 12:36:54 MSD 2008


On Tue, Sep 16, 2008 at 12:37:12PM +0400, Maxim Dounin wrote:

> Hello!
> 
> On Tue, Sep 16, 2008 at 01:18:18AM -0700, mike wrote:
> 
> >Actually I think I've got this working, although I will take your
> >regexp for the expires block into account.
> >
> >       server {
> >               listen 80;
> >               server_name test.com;
> >               index index.php;
> >               root /home/test/web/test.com/rfdev;
> >               rewrite /icommon/(.*) /common/$1 last;
> 
> Rewrite at server level will be executed against all requests, so 
> it's not recommended.  It's better to use something like
> 
>                  location /icommon/ {

-                  location /icommon/ {
+                  location ^~ /icommon/ {

>                          rewrite ^/icommon/(.*)  /common/$1  last;
>                  }
> 
> Maxim Dounin
> 
> >               location /common {
> >                       root /home/test/web/test.com/rfdev/core;
> >                       location ~ \.php$ {
> >                               fastcgi_pass 127.0.0.1:11004;
> >                       }
> >                       location ~* 
> >                       ^.+\.(jpg|jpeg|gif|css|png|js|ico|html)$ {
> >                               expires max;
> >                       }
> >               }
> >               location ~ \.php$ {
> >                       fastcgi_pass 127.0.0.1:11004;
> >               }
> >       }
> >
> >
> >On Tue, Sep 16, 2008 at 12:56 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> >>Hello!
> >>
> >

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





More information about the nginx mailing list