title: Accept only subdomain in nginx
body: <p>I have a reverse proxy set up in nginx for a node.js server.</p>
  
  <pre><code>server {
      listen 80;
  
      server_name sub.domain.tld;
  
      location / {
          proxy_pass http://localhost:3000;
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
          proxy_set_header Host $host;
          proxy_cache_bypass $http_upgrade;
      }
  }
  </code></pre>
  
  <p>It works all fine and dandy, however, I <em>only</em> want <code>sub.domain.tld</code> to work. Opening up  <code>domain.tld</code> in a browser still routes to the node.js server.</p>