Wednesday, March 5, 2014

Configure nginx to server multiple domains / subdomains

With nginx it is quite easy to configure multiple domains or subdomains to be served from single server. Refer following configuration for the same.

    server {
        server_name first.pandurangpatil.com;
        root /var/www/first;
    }

    server {
        server_name second.pandurangpatil.com;
        root /var/www/second;
    }

    server {
        server_name someother.com;
        root /var/www/other;
    }



No comments:

Post a Comment