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

Do two nginx configuration files operate independently to each other, or can they affect each other in some way?

For example, can I name the upstream block in two configuration files with the same name without causing a conflict?

share|improve this question
up vote 2 down vote accepted

If you mean configuration files usually found in the conf.d/ directory - no, they're not independent, because they're all included in the main nginx.conf and for nginx they all look like one big configuration file. They're separated just for administration convenience - it's easier to support multiple logically partitioned configuration than one big, messy file.

share|improve this answer
I mean the conf files under sites-enabled/ directory. Is this what you thought I meant? – lulalala Jul 5 '12 at 6:50
Yep, it's pretty much the same for them - they're all included in the main nginx.conf too, so they can affect each other. – Vladimir Blaskov Jul 5 '12 at 6:52
Thanks, may I ask what else might potentially cross pollute the global setting beside the name for upstream? – lulalala Jul 5 '12 at 6:56
Pretty much everything that's outside of server { ... } blocks. – Vladimir Blaskov Jul 5 '12 at 7:03

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.