Need Help Configuring Nginx to run Wordpress

Todd HG lists at
Thu Apr 24 00:32:24 MSD 2008

I run Wordpress 2.5 under Apache 2.2 on a RedHat 5 ES server with no
problems, and use Nginx to serve images, but I can't seem to get the
right configuration to run Wordpress under Nginx. I have a script that
runs the launches /usr/bin/spawn-fcgi on localhost IP using
port 8437, and running a process as php-cgi.

Once I switch over Wordpress to Nginx I can view and interact with the
Wordpress control panel, which means PHP is working fine, but I can't
view the web site home page, or any articles. I get a grey blank page,
not even a 404 error. I am unable to figure this out without help. My
configuration is below.

    server {
        listen       my-ip-address:80;

        location / {
        root    /var/www/mydomain;
        index  index.php index.html index.htm;

        if (!-e $request_filename) {
            rewrite ^(.+)$ /index.php?q=$1 last;
        error_page  404    ;

location ~ \.php$ {
     fastcgi_index index.php;
     fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
     fastcgi_param  SERVER_SOFTWARE    nginx;
     fastcgi_param  QUERY_STRING       $query_string;
     fastcgi_param  REQUEST_METHOD     $request_method;
     fastcgi_param  CONTENT_TYPE       $content_type;
     fastcgi_param  CONTENT_LENGTH     $content_length;
     fastcgi_param  SCRIPT_FILENAME
     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  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;
#     fastcgi_param  REDIRECT_STATUS    200;
Posted via

More information about the nginx mailing list