Basic Auth + PHP

Roxis roxis at list.ru
Fri Jul 25 20:31:31 MSD 2008


On Friday 25 July 2008, Bubulino Werty wrote:
> Hi guys,
> I've already been browsing this forum, but all other solutions don't
> work so far.
>
> I have a simple nginx + fastcgi setup.
>
> location ~ \.php$ {
>             fastcgi_pass   127.0.0.1:9000;
>             fastcgi_index  index.php;
>             include        /usr/local/nginx/conf/fastcgi_params;
>         }
>
> I now want the /admin/ directory, including all .php files, to be
> secure, but couldn't manage to do that. The rewrite tricks from older
> threads didn't work.
>
> Anyone got a configuration example?
>
> Thanks!

you need two additional locations
first one is "location /admin"
and second one (before location ~ \.php$) "location ~ ^/admin/.+\.php$"





More information about the nginx mailing list