title: nginx subdomain configuration on virtual host
body: <p>There are several questions on SO about nginx subdomain configuration but didn't find one that exactly the same as mine.</p>
  
  <p>Say I got a virtual host <code>some.example.com</code> from higher-level net admin <code>example.com</code> at our organization. I want to use <code>some.example.com</code> as my primary site and use <code>foo.some.example.com</code> and <code>bar.some.example.com</code> for auxiliary usage (proxy, etc). I tried this simple configuration and put it under <code>sites-enabled</code> but didn't work:</p>
  
  <pre><code>server {
      listen 80; 
      server_name some.example.com;
      root /home/me/public_html/some;
      index index.html index.htm;
  }
  
  server {
      listen 80; 
      server_name foo.some.example.com;
      root /home/me/public_html/foo;
      index index.html index.htm;
  }
  
  server {
      listen 80; 
      server_name bar.some.example.com;
      root /home/me/public_html/bar;
      index index.html index.htm;
  }
  </code></pre>
  
  <p>In this setting <code>some.example.com</code> works fine, but for the other two browser return that <code>could not find foo.some.example.com</code>. I'm running it on a ubuntu server.</p>
  
  <p>Is there something wrong with this configuration? Or is it something I should talk to higher level net admin (make <code>foo.some.example.com</code> and <code>bar.some.example.com</code> to be registered)?</p>