Fwd: Re: Troubles with http basic authentication.
Igor Sysoev
is at rambler-co.ru
Mon Oct 1 13:02:10 MSD 2007
On Mon, Oct 01, 2007 at 04:00:20PM +0700, Denis F. Latypoff wrote:
> 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/ {
- location /admin/ {
+ location ^~ /admin/ {
then it will be in /admin/ only.
> auth_basic .....
>
> location ~ \.php5$ {
> fastcgi_pass ....
> }
> }
>
> request '/admin/index.php' will be handled in the regular scope (first location).
--
Igor Sysoev
http://sysoev.ru/en/
More information about the nginx
mailing list