WordPress Multisite with multiple domains using Nginx

I don’t have enough reputation for comments and hope I don’t get down voted here.

I also use Nginx. Although my set up is a little different to yours the principal should be the same.

In your nginx.conf you need to identify the domain names Nginx will handle. For example;

    http {

        include /etc/nginx/sites-enabled/*.conf;

        server {
                listen 0.0.0.0:80; # IP address Nginx will listen on
                server_name example.com subdomain.example.com;
               } # End server

          } # End http

In my sites-enabled folder I have symbolic links to the configuration files for each domain located in the sites-available folder.

# example.com.conf
server {
        server_name example.com;

        # Now include your other directives related to example.com
       }

# subdomain.com.conf
server {
        server_name subdomain.example.com;

        # Now include other directives related to subdomain.example.com
       }

My set up is very different to yours. I use Nginx as a caching server for Apache at the back end, but the principals should be the same. Your folder directives related to each of your domains are placed in their respective config files.

Nginx will serve pages from where ever your config tells it.

If this is completely wrong then let me know and I’ll remove it. Don’t down vote as I really need the reputation points 🙂

Leave a Comment