Wordpress (single blog installation) and nginx

Igor Sysoev is at rambler-co.ru
Sun Dec 16 17:47:02 MSK 2007


On Sun, Dec 16, 2007 at 03:34:44PM +0100, Abdul-Rahman Advany wrote:

> That doesn't work, it just handles the admin/index.php?bla=bla but not
> /?bla=bla and give the args to index.php
> 
> Also tried to remove from server level en put in both location blocks,
> doesn't work...

You should use "set   $orig_args   $args;" on server level only.

> I can life with this but would be good if I could figure it our for
> the 5.xxbranch...

It will be merged in 0.5.35, probably before New Year.

> On 12/16/07, Igor Sysoev <is at rambler-co.ru> wrote:
> >
> > On Sat, Dec 15, 2007 at 11:25:39PM +0100, Abdul-Rahman Advany wrote:
> >
> > > haha, yeah, good hack, but know its not passing the params when I have
> > > like www.blog.com/admin/index.php?edit=5
> > >
> > > Is there some coditional coding I can do?
> > >
> > > If $orig_args
> > >       fastcgi_param  QUERY_STRING       $orig_args;
> > > else
> > >       fastcgi_param  QUERY_STRING       $args;
> >
> > You need to move
> >
> >         set   $orig_args   $args;
> >
> > to a server level.
> >
> > >
> > > ....
> > >
> > > On Dec 15, 2007, at 9:11 PM, Igor Sysoev wrote:
> > >
> > > >On Sat, Dec 15, 2007 at 08:58:02PM +0100, Abdul-Rahman Advany wrote:
> > > >
> > > >>I was on nginx 5.26... gave a error, upgraded to 5.33 and getting the
> > > >>same error...
> > > >>
> > > >>2007/12/15 19:56:07 [emerg] 28620#0: unknown "arg" variable
> > > >>
> > > >>even tried
> > > >>
> > > >>- error_page  404 = /index.php?$arg;
> > > >>+ error_page  404 = /index.php?$args;
> > > >
> > > >Yes, I missed: it should be "$args".
> > > >However, you need 0.6.x branch to use it.
> > > >
> > > >There's another way:
> > > >
> > > >You should inline /etc/nginx/fastcgi.conf to change
> > > >   fastcgi_param  QUERY_STRING       $query_string;
> > > >to
> > > >   fastcgi_param  QUERY_STRING       $orig_args;
> > > >
> > > >and use following configuration (important places are marked by "!"):
> > > >
> > > >   location / {
> > > >        root /var/www/blog;
> > > >!        set   $orig_args   $args;
> > > >        error_page  404 = /index.php;
> > > >   }
> > > >
> > > >   location ~ \.php$ {
> > > >        fastcgi_pass 127.0.0.1:8888;
> > > >        fastcgi_param  SCRIPT_FILENAME  /var/www/blog/
> > > >$fastcgi_script_name;
> > > >
> > > >!        fastcgi_param  QUERY_STRING       $orig_args;
> > > >        fastcgi_param  REQUEST_METHOD     $request_method;
> > > >        fastcgi_param  CONTENT_TYPE       $content_type;
> > > >        fastcgi_param  CONTENT_LENGTH     $content_length;
> > > >
> > > >        fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
> > > >        fastcgi_param  REQUEST_URI        $request_uri;
> > > >        fastcgi_param  DOCUMENT_URI       $document_uri;
> > > >        fastcgi_param  DOCUMENT_ROOT      $document_root;
> > > >        fastcgi_param  SERVER_PROTOCOL    $server_protocol;
> > > >
> > > >        fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
> > > >        fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
> > > >
> > > >        fastcgi_param  REMOTE_ADDR        $remote_addr;
> > > >        fastcgi_param  REMOTE_PORT        $remote_port;
> > > >        fastcgi_param  SERVER_ADDR        $server_addr;
> > > >        fastcgi_param  SERVER_PORT        $server_port;
> > > >        fastcgi_param  SERVER_NAME        $server_name;
> > > >
> > > >        # PHP only, required if PHP was built with --enable-force-
> > > >cgi-redirect
> > > >        fastcgi_param  REDIRECT_STATUS    200;
> > > >   }
> > > >
> > > >
> > > >
> > > >>On Dec 15, 2007, at 8:12 PM, Igor Sysoev wrote:
> > > >>
> > > >>>On Sat, Dec 15, 2007 at 09:45:25PM +0300, Igor Sysoev wrote:
> > > >>>
> > > >>>>On Sat, Dec 15, 2007 at 07:37:00PM +0100, Abdul-Rahman Advany
> > > >>>>wrote:
> > > >>>>
> > > >>>>>There seems to be an other problem, it doesn't pass the params
> > > >>>>>so...
> > > >>>>>blog.domain.com/?page_id=2 doesn't work, where
> > > >>>>>blog.domain.com/index.php?page_id=2 does work, I added both
> > > >>>>>requirest_uri
> > > >>>>>and path_info, but no success. Can't find much on it on the
> > > >>>>>mailinglist.
> > > >>>>
> > > >>>>        error_page  404 /index.php?$arg;
> > > >>>
> > > >>>-            error_page  404 /index.php?$arg;
> > > >>>+            error_page  404 = /index.php?$arg;
> > > >>>
> > > >>>
> > > >>>--
> > > >>>Igor Sysoev
> > > >>>http://sysoev.ru/en/
> > > >>>
> > > >>
> > > >>
> > > >
> > > >--
> > > >Igor Sysoev
> > > >http://sysoev.ru/en/
> > > >
> > >
> > >
> >
> > --
> > Igor Sysoev
> > http://sysoev.ru/en/
> >
> >
> 
> 
> -- 
> Abdul-Rahman Advany
> 
> IM: abdulrahman at advany.com

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





More information about the nginx mailing list