The MU forums have moved to WordPress.org

Nginx, Wordpress MU, editing on secondary blogs (2 posts)

  1. philosophersam
    Member
    Posted 16 years ago #

    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?

  2. andrea_r
    Moderator
    Posted 16 years ago #

    Yeah, we're running a site on nginx - there's a small number of threads here with the rewrite rules required.

    It's picky, but a heckofa lot faster. :D

About this Topic

  • Started 16 years ago by philosophersam
  • Latest reply from andrea_r