Location confusion

Igor Sysoev is at rambler-co.ru
Wed Dec 5 19:04:45 MSK 2007


On Wed, Dec 05, 2007 at 04:50:42PM +0100, Alexander Staubo wrote:

> On 12/5/07, Igor Sysoev <is at rambler-co.ru> wrote:
> > On Wed, Dec 05, 2007 at 03:20:48PM +0000, Igor Clark wrote:
> > > At the moment the "~ .php$" block seems to be taking precedence,
> > > meaning that e.g. /admin/index.php is served without a username &
> > > password, which is not what I intend. I've tried various combinations
> > > but none have done exactly what I want; I'm sure it's simple!
> >
> >     location ~ \.php$ {
> >         # fastcgi stuff
> >     }
> >
> >     location ^~ /admin/ {
> >         # auth_basic stuff
> >
> >         location ~ \.php$ {
> >             # fastcgi stuff
> >         }
> >     }
> 
> This has bugged me, too. It results in unnecessary config duplication.
> It sure would be useful to have a kind of block that "cut through" all
> locations, similar to Lighttpd's condition blocks.

The "cut through" is good when you have pair of locations.
One of my site has 110 locations now. When I add new location I have to
see http and server levels only. I have not to look carefully all 110
locations to see if there is something that may affect the new location.

I call this configuration scalability.


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





More information about the nginx mailing list