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

mike mike503 at gmail.com
Sat Aug 16 13:03:59 MSD 2008


Okay, I applied two patches and that same config that was working in
0.7.8 and wordpress admin is back to not parsing PHP...



root at local:/usr/src/build/nginx-0.7.10# patch -p1 <
../nginx-patches/0.7.10-staticpost.txt
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: src/http/modules/ngx_http_static_module.c
|===================================================================
|--- src/http/modules/ngx_http_static_module.c  (revision 1500)
|+++ src/http/modules/ngx_http_static_module.c  (working copy)
--------------------------
File to patch: src/http/modules/ngx_http_static_module.c
patching file src/http/modules/ngx_http_static_module.c


root at local:/usr/src/build/nginx-0.7.10# patch -p1 <
../nginx-patches/0.7.8-dirtest.txt
patching file src/http/modules/ngx_http_index_module.c
Hunk #1 succeeded at 309 with fuzz 1.
root at local:/usr/src/build/nginx-0.7.10#



On 8/16/08, Igor Sysoev <is at rambler-co.ru> wrote:
> On Sat, Aug 16, 2008 at 01:02:51AM -0700, mike wrote:
>
> > On 8/16/08, Igor Sysoev <is at rambler-co.ru> wrote:
> >
> > > Do you have something like "location ~ \.php$" before
> > > "location ~ /wordpress/admin(.+)" ?
> > > If so, the former matchs "/wordpress/admin/post-new.php".
> >
> > yes i do, here's the entire config:
> >
> >
> >   server {
> >     listen 80;
> >     server_name foo.com;
> >     index index.php index.html;
> >     root /home/mike/web/foo.com/;
> >     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;
> >         fastcgi_index index.php;
> >       }
> >     }
> >     location ~ \.php$ {
> >       fastcgi_pass 127.0.0.1:11000;
> >       fastcgi_index index.php;
> >     }
> >     if (!-e $request_filename) {
> >       rewrite ^(.+)$ /wordpress/index.php?q=$1 last;
> >     }
> >   }
>
> Apply the attached patch that allows POST for non-existent static files
> and try the following configuration:
>
>    server {
>        listen 80;
>        server_name foo.com;
>        index index.php index.html;
>        root /home/mike/web/foo.com/;
>
>        error_page 404 = /wordpress/index.php?q=$request_uri;
>
>        location / {
>        }
>
>        location ^~ /wordpress/admin {
>
>            auth stuff
>
>            location ~ \.php$ {
>                 fastcgi_pass 127.0.0.1:11000;
>                 # fastcgi_index is not needed here
>            }
>        }
>
>        location ~ \.php$ {
>            fastcgi_pass 127.0.0.1:11000;
>            # fastcgi_index is not needed here
>            }
>        }
>    }
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
>





More information about the nginx mailing list