Single nginx configuration for multiple sub domains

Posted by Peter Smit on Server Fault See other posts from Server Fault or by Peter Smit
Published on 2010-05-06T06:33:35Z Indexed on 2010/05/06 6:38 UTC
Read the original article Hit count: 342

Filed under:
|
|

I have the following directory structure for my websites:

/var/www/sitename/subdomain/(public|log)

e.g /var/www/stackoverflow.com/careers/public/index.html

Can I make a single generic nginx configuration to do this? So that every domain is mapped to the right directory? I would not like to edit my nginx configuration for every website I add.

The root domain can always be mapped to the www subdomain.

© Server Fault or respective owner

Related posts about nginx

Related posts about configuration