Basic Auth + PHP

mike mike503 at gmail.com
Sat Jul 26 06:24:26 MSD 2008


yeah you have to nest the locations

                location /phpmyadmin {
                        auth_basic "phpMyAdmin";
                   auth_basic_user_file /home/foo/.htpasswd;
                        location ~ \.php {
                                fastcgi_pass 127.0.0.1:11011;
                                fastcgi_index index.php;
                        }
                }

doesn't seem like the cleanest way but oh well :)


On 7/25/08, Bubulino Werty <lists at ruby-forum.com> 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!
> --
> Posted via http://www.ruby-forum.com/.
>
>





More information about the nginx mailing list