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

Igor Sysoev is at rambler-co.ru
Sun Aug 17 11:28:49 MSD 2008


On Sun, Aug 17, 2008 at 12:19:50AM -0700, mike wrote:

> On 8/16/08, Igor Sysoev <is at rambler-co.ru> wrote:
> 
> > The attached patch should fix two inclusive bugs.
> >
> > If will not help, the current workaround is to use one level locations:
> >
> >    location ~ /wordpress/wp-admin {
> >        auth
> >    }
> >
> >    location ~ /wordpress/wp-admin/.*\.php$ {
> >        auth
> >        fastcgi
> >    }
> >
> >    location ~ \.php$ {
> >        fastcgi
> >    }
> 
> I love how small code-wise these changes are for such functional
> differences. nginx is a technical marvel - so much functionality with
> such little code!
> 
> I will try out this patch, but I am curious - why isn't my existing
> method using the plain old /wordpress/wp-admin.* regex an acceptable
> workaround (until this "bug" as you've said is fixed) - or is this
> patch the "fix" for that behavior, if it works?

The three following configuration do not work without the patch:

(yours with regex)

   location ~ /wordpress/wp-admin {
       auth

       location ~ \.php$ {
          fastcgi
       }
   }

   location ~ \.php$ {
      fastcgi
   }

(disable regex ^~)

   location ^~ /wordpress/wp-admin {
       auth

       location ~ \.php$ {
          fastcgi
       }
   }

   location ~ \.php$ {
      fastcgi
   }

(static locations)

   location /wordpress/wp-admin {
       auth

       location ~ \.php$ {
          fastcgi
       }
   }

   location ~ \.php$ {
      fastcgi
   }


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





More information about the nginx mailing list