I've got Wordpress MU running on Nginx 0.7.62. This is roughly what I'm using for the site config for nginx (from Nginx Wiki):
server {
listen 80;
server_name http://www.myblog.com;
access_log /var/log/nginx/myblog.com-access.log;
location / {
root /var/www/wordpress;
index index.php;
try_files $uri /index.php;
}
location /wp-admin {
root /var/www/wordpress;
index index.php;
try_files $uri /wp-admin/index.php;
}
location ~ \.php$ {
root /var/www/wordpress;
fastcgi_pass 127.0.0.1:8888;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
The only major problem I'm having is I have a second blog in Wordpress MU called "sham". So, when attempting to see the Dashboard (admin) page for this install(the links point here: http://test.com/sham/wp-admin), I see the main page.
I understand why nginx is sending that to the index.php file. I'm just having a very hard time writing a regex for the location rule to route anything that has /wp-admin/ in it to the /wp-admin/index.php. I got it to work once, with this:
location ~* ^/.*(/wp-admin/.*)$ { ...
but then it would seem to fail to download required JavaScript and CSS files (the page displayed improperly). Please note that everything on the main blog works fine. I can edit posts, add comments, etc.
Does anyone have any suggestions on how to get nginx to handle this cleanly?