Location confusion

Manlio Perillo manlio_perillo at libero.it
Wed Dec 5 20:14:59 MSK 2007


Alexander Staubo ha scritto:
> 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.

You can always use the include directive.



Manlio Perillo





More information about the nginx mailing list