How does 'locate' work?

Maxim Dounin mdounin at
Thu Oct 22 17:25:44 MSD 2009


On Thu, Oct 22, 2009 at 01:52:59PM +0200, Artifex Maximus wrote:

> Hello!
> On Thu, Oct 22, 2009 at 1:35 AM, Maxim Dounin <mdounin at> wrote:
> > On Wed, Oct 21, 2009 at 04:50:38PM -0400, GAZ082 wrote:
> >
> > But this is really fragile.  As soon as new regex location appears
> > - you'll have to add another one to preserve auth_basic.  More
> > safe aproach is to use nested locations, i.e.:
> >
> Since which version? I had some problem and using 'alias /l/$1' for PHP
> scripts because of missing nested location. So it is time to change? :-)

Nested location are allowed by config syntax from 0.1.0 (first 
public release).  But they may have various bugs in various 
versions.  Example I've provided should work on all supported 
branches including legacy 0.6.*, though I've never checked.

Note well: alias directive is one that likely has problems with 
nested locations.

Maxim Dounin

More information about the nginx mailing list