Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.