Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So in the past, I've just had one nginx.conf file. I'd like to separate this out for each domain (right now there's two), but to stay organized in case there's more.

How is this possible to let each domain have it's own .conf file?

share|improve this question
up vote 4 down vote accepted

Sure.. This is how I do it in the nginx.conf in the http {} block I do

include /etc/nginx/vhosts.d/*.conf;

Then each vhost has its own seperate vhost file. To make it easy they are named like


In those files you have your normal server {} blocks for the vhost

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.