How To Configure Multiple WordPress Sites in Subdirectories in nginx

Posted March 8, 2014 17.5k views
Can i have multiple WordPress installations in subdirectories in nginx? Example: - - - How can i do this with permalinks working?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
5 answers
I followed this tutorial:

So, i added a "location sitex.." for each site.

Something like this:
by Santiago Ti
WordPress is a popular CMS (content management system). In this tutorial, you will configure NGINX for various types of WordPress installations, including multisite configurations, rewrite rules and the use of .conf files to apply repeated configurations.

i did it like this and works fine even for permalinks! (diud not get the permalinks working with the pastebin example)

        root /var/www/siteroot
        index index.php index.html index.htm;

        # Make site accessible from http://localhost/

        location / {
                try_files $uri $uri/ =404;

        location /site1 {
                index index.php index.html index.htm;
                try_files $uri $uri/ /site1/index.php?q=$uri&$args;

        location /site2 {
                index index.php index.html index.htm;
                try_files $uri $uri/ /site2/index.php?q=$uri&$args;
Take a look at installing easyengine on your droplet to take care of Nginx , WordPress and subfolders/server blocks.
Look here
Hi, I found a solution.

But I will try easyengine. Seems to be easy.

Hi Rodrigo,

Could you please share your solution with me?