Another auth/location question - probably very simple to fix :)

mike mike503 at gmail.com
Sun Aug 17 02:00:34 MSD 2008


On Sat, Aug 16, 2008 at 1:07 PM, Igor Sysoev <is at rambler-co.ru> wrote:

> Looking at code, I've found that simple should work:
>
>          location /wordpress/admin {
>
> If nginx has found maximum static match, it look inclusive static and
> regex locations. The matched inclusive regex location stops searching.
>
> It seems that inclusive locations should be documented:  forgot how they
> works :).

this works:
               location ~ /wordpress/wp-admin.* {
                        auth_basic "wordpress";
                        auth_basic_user_file /home/mike/web/foo.com/.htpasswd;
                        location ~ \.php$ {
                                fastcgi_pass 127.0.0.1:11000;
                        }
                }

this does not:

                location /wordpress/admin/ {
                        auth_basic "wordpress";
                        auth_basic_user_file /home/mike/web/foo.com/.htpasswd;
                        location ~ \.php$ {
                                fastcgi_pass 127.0.0.1:11000;
                        }
                }

and this is the only other location block in that server block...

                location ~ \.php$ {
                        fastcgi_pass 127.0.0.1:11000;
                }





More information about the nginx mailing list