Fwd: Re: Troubles with http basic authentication.

Denis F. Latypoff denis at gostats.ru
Mon Oct 1 13:00:20 MSD 2007


Hello Matteo,

Monday, October 1, 2007, 3:42:01 PM, you wrote:

> Maxim Dounin ha scritto:
>> You should use something like this:
>> 
>> location /admin/ {
>>      auth_basic ...
>> }
>> location ~ ^/admin/.*\.php5$ {
>>      auth_basic ...
>>      fastcgi_pass ...
>> }

> Ok thanks, should be ok. But, there's no possibility to define location
> into under location? Some like this:

> location /admin/ {
>         auth_basic .....

>         location ~ \.php5$ {
>                 fastcgi_pass ....
>         }
> }

> So the last location should be inherit properties of the upper location?

even if location inside location works, there no sense to do that, look:


location ~ \.php5$ {
        # regular php scripts
        fastcgi_pass ....
}

location /admin/ {
        auth_basic .....

        location ~ \.php5$ {
                fastcgi_pass ....
        }
}

request '/admin/index.php' will be handled in the regular scope (first location).

-- 
Best regards,
 Denis                            mailto:denis at gostats.ru






More information about the nginx mailing list