Wordpress (single blog installation) and nginx

Igor Sysoev is at rambler-co.ru
Sat Dec 15 23:11:21 MSK 2007


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/





More information about the nginx mailing list