Here’s a quick tip if you’re on Nginx with multiple WordPress installations in a sub-folder of your main WordPress and you want pretty permalinks to work correctly.

The problem is this: We’re running WPMU on our TLD but have mockups in a subdirectory (e.g. In that folder, there are multiple folders that each contain a copy of WordPress.

With Nginx’s default settings, you’ll get errors and odd behavior if you try to enable pretty permalinks on the subdirectory WP installs while concurrently running pretty permalinks on your TLD’s WP ( which is why you’re here in the first place ). The solution to getting everyone to behave nicely is a custom entry for each of your subdirectories in the corresponding .conf file.

Here’s what I have:

  • (WPMU)
  • (WP)
  • (WP)

Go to your Nginx configuration file for the, and find the part where Nginx starts handing locations. You want to process these requests before looking for files served from your, so add a location block that looks like this:

server {


  root /path/to/main/wordpress;

  access_log /var/log/nginx/;
  error_log /var/log/nginx/;

  include /etc/nginx/conf.d/restrictions.conf;
  include /etc/nginx/conf.d/wordpress.conf;

  location /subdir/ {
    try_files $uri $uri/ /subdir/$args;

  location /subdir/ {
    try_files $uri $uri/ /subdir/$args;

The above example assumes that you have two folders, and, sitting in a subdirectory that exists alongside your WPMU installation (at Here’s what happens: First, your WPMU root is established in this server instance. Every time someone visits your domain, it will look for the files to serve in that folder. Since your other WordPress installations are in sub-folders, you need to tell this server block to listen for people accessing those locations, that way the server delivers the appropriate WP files.

Once you’ve modified your .conf file, be sure to run the following command to reload Nginx:

service nginx reload

If you’re having trouble or have some questions, leave a comment.

Jesse Lawson

I write science fiction and research multi-agent systems for cognition and intelligence simulation. More importantly, I love breakfast burritos.

lawsonry lawsonry