title: How to configure multiple sub-domain in nginx?
body: <p>I want to add sub-domains to my website which is hosted on <code>nginx</code>. For this I've added the sub-domain name to the <code>nginx.conf</code> file. But whenever I try to access the sub-domain outside localhost it redirects me to the <code>http://id.domain-error.com/noresult.php</code>. </p>
  
  <p>Here's my <code>nginx.conf</code> file:</p>
  
  <pre><code>http {
  
      server {
      listen 80; # Incoming port for Nginx
      server_name www.example.com example.com;
      index index.html index.htm;
      location / {
             root /usr/share/nginx/example;
             try_files $uri $uri/ =404;
             }
      }
      server {
      listen 80; # Incoming port for Nginx
      server_name hello.example.com;
      index index.html index.htm;
      location / {
             root /usr/share/nginx/some_other_example;
             try_files $uri $uri/ =404;
             }
      }
    }
  </code></pre>
  
  <p>Can anyone tell me what I'm missing here ?</p>