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

Igor Sysoev is at rambler-co.ru
Sat Aug 16 21:52:28 MSD 2008


On Sat, Aug 16, 2008 at 03:19:23AM -0700, mike wrote:

> okay i've fixed it.
> 
> currently running 0.7.10 with maxim's dirlist patch (had some fuzz)
> and your static post patch.
> 
> config is:
> 
>        server {
>                 listen 80;
>                 server_name foo.com;
>                 index index.php index.html;
>                 root /home/mike/web/foo.com/;
>                 include /etc/nginx/defaults.conf;
>                 include /etc/nginx/expires.conf;
>                 error_page 404 = /wordpress/index.php?q=$request_uri;
>                 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;
>                         }
>                 }
>                 location ~ \.php$ {
>                         fastcgi_pass 127.0.0.1:11000;
>                 }
>         }
> 
> apparently the regex i tried earlier for admin was wrong. i had the
> right idea though.

Have you tried

-                 location ~ /wordpress/admin.* {
+                 location ^~ /wordpress/admin {

?

> i would like to know what the behavior will be when you apply the
> dirlist patch to know if i need to adjust my side or not. thanks :)

You will not need to adjust anything.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list