title: Is it possible to split a server config into small ones in NGINX?
body: <p>Having a virtualserver with lots of <code>location</code> directives in Nginx, is it possible to separate them into several files?</p>
  
  <p>Example:</p>
  
  <p>onefile.conf</p>
  
  <pre><code>server {
      listen 80;
      server_name domain.com;
  
      location 1 { ... }
      location 2 { ... }
      location 3 { ... }
  }
  </code></pre>
  
  <p>Change to:</p>
  
  <p>server.conf</p>
  
  <pre><code>server {
      listen 80;
      server_name domain.com;
  
      include server.location1.conf
      include server.location2.conf
      include server.location3.conf
  }
  </code></pre>
  
  <p>server.location1.conf</p>
  
  <pre><code>server {
      listen 80;
      server_name domain.com;
  
      location 1 { ... }
  }
  </code></pre>
  
  <p>server.location2.conf</p>
  
  <pre><code>server {
      listen 80;
      server_name domain.com;
  
      location 2 { ... }
  }
  </code></pre>
  
  <p>server.location3.conf</p>
  
  <pre><code>server {
      listen 80;
      server_name domain.com;
  
      location 3 { ... }
  }
  </code></pre>