How To Configure Multiple WordPress Sites in Subdirectories in nginx

March 8, 2014 6.1k views
Can i have multiple WordPress installations in subdirectories in nginx? Example: - - - How can i do this with permalinks working?
5 Answers
I followed this tutorial:

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

Something like this:
by Santiago Ti
WordPress is the most popular CMS (content management system) used on the internet today. WordPress sites can be served using a HTTP server such as Apache or NGINX, while Apache is a great option to serve websites, many sites have moved to NGINX because of it's scalable event-driven architecture, low resources and better delivery of statics files. In this tutorial, you will learn how to 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?

Have another answer? Share your knowledge.