nginx + wordpress in /wordpress subdir
- by nkr1pt
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!