title: Configure nginx with multiple locations with different root folders on subdomain
body: <p>I'm looking to serve the root url of a subdomain and directory of a subdomain to two different folders on my server. Here is the simple set-up that I have and is not working...</p>
  
  <pre><code>server {
  
      index index.html index.htm;
      server_name test.example.com;
  
      location / {
              root /web/test.example.com/www;
      }
  
      location /static {
              root /web/test.example.com/static;
      }
  }
  </code></pre>
  
  <p>In this example going to <code>test.example.com/</code> would bring the index file in <code>/web/test.example.com/www</code></p>
  
  <p>and going to <code>test.example.com/static</code> would bring the index file in <code>/web/test.example.com/static</code></p>