nginx + wordpress in /wordpress subdir

Posted by nkr1pt on Server Fault See other posts from Server Fault or by nkr1pt
Published on 2011-02-18T20:40:59Z Indexed on 2011/02/19 15:26 UTC
Read the original article Hit count: 554

Filed under:
|
|

I installed nginx and would like to setup wordpress as a final step. I followed many howtos but am unable to get it working.

The setup is fairly straightforward, the root dir of the webserver is /data/Sites/nkr1pt.homelinux.net. In that root dir I created a symlink to the wordpress folder in /usr/local/wordpress, so in fact all wordpress files can be accessed at /data/Sites/nkr1pt.homelinux.net/wordpress. Permissions are ok.

The plan is to get wordpress working at http://sirius/wordpress, the server's name is sirius. spawn-fcgi is running and listening on port 7777.

Here you can see the relevant config:

server {
    listen       80;
listen       8080;
    server_name  sirius;

root /data/Sites/nkr1pt.homelinux.net;
passenger_enabled on;
    passenger_base_uri /redmine;

    #charset koi8-r;

    #access_log  logs/access.log  main;

location ^~ /data {
   root /data/Sites/nkr1pt.homelinux.net;
   autoindex on;
   auth_basic "Restricted";
   auth_basic_user_file htpasswd;
}

    location ^~ /dump {
        root   /data/Sites/nkr1pt.homelinux.net;
        autoindex on;
    }

location ^~ /wordpress {
       try_files $uri $uri/ /wordpress/index.php;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:7777
    location ~ \.php$ {
    #fastcgi_split_path_info ^(/wordpress)(/.*)$;
        fastcgi_pass   localhost:7777;
        #fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    #index     index.php;
    }

please note that redmine, and the locations dump and data are working perfectly, it is only wordpress that I cannot get to work.

Can you please help me to the correct wordpress configuration in nginx? All help is much appreciated!

© Server Fault or respective owner

Related posts about php

Related posts about nginx