Multisite in subfolder


I posted a comment few days ago, but couldn’t solve it.

I installed nginx+php5-fpm on ubuntu, and I have domain with multisite in subfolder
Your nginx helper plugin is installed on both, but permalinks are not working on multisite, and also the demo sites (, etc). I always get 404 from my main site.

This is my nginx.conf:,
and this is my sites-enabled file:

After visiting few times some of demos (
I got nothing in, or error.log from var/log/nginx.

What could be the issue?

Sorry for delayed reply.

Looks like you have got caching involved - (W3TC).

For multisite in subdirectory, try this config instead -

If you get it working, we can add caching support later on.

Try config at above link and let us know if it works.

Figured it out… Problem was in fastcgi pass.

        location ~ \.php$ {  
                try_files $uri /multisite/index.php;  
                include         fastcgi_params;  


This is how it’s working. Thank you a lot!

Glad to know that. :slight_smile:

I am marking this issue resolved. Feel free to create new support topic, if need arises.

[moderatio note: threads are merged]


since the thread is closed, and I was wrong by saying it’s all working, you might want to link this solution, or even update a post (there’s a fair chance that main site is wp too).

With previous nginx configuration my multisite in subdirectory was working, but permalinks on the main site didn’t. I just noticed that, and I wanted to post a solution here:

server {  

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

        root /srv/www/;  
        index index.php;  

        if (!-e $request_filename) {  
                rewrite /wp-admin$ $scheme://$host$uri/ permanent;  
                rewrite ^/multisite(/[^/]+)?(/wp-.*) /multisite$2 last;  
                rewrite ^/multisite(/[^/]+)?(/.*\.php)$ /multisite$2 last;  

        location / {  
                try_files $uri $uri/ /index.php?$args ;  
        # Remember to change multisite to your subdirectory name  
        location /multisite {  
                try_files $uri $uri/ /multisite/index.php?$args ;  

        location ~ \.php$ {  
                try_files $uri /multisite/index.php;  
                include fastcgi_params;  

        location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|d$  
                access_log off; log_not_found off; expires max;  

        location = /robots.txt { access_log off; log_not_found off; }  
        location ~ /\. { deny  all; access_log off; log_not_found off; }  


Merged thread. Thanks for sharing your config. :slight_smile: