Location confusion

Alexander Staubo alex at purefiction.net
Wed Dec 5 18:50:42 MSK 2007


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.

Alexander.





More information about the nginx mailing list