title: Nginx Reverse Proxy non listening domain catch all
body: <p>Using nginx as a reverse proxy I have noted that if a site is pointed at the server but does not actually exist you get served with an existing site on the server rather than a domain cannot be found message or similar.</p>
  
  <p><strong>ie</strong> say your config block is listening for portal.test.org the user points there <strong>cname</strong> to the nginx system but with the domain header of <strong>smartportal.test.org</strong></p>
  
  <p>or say the they point a site like <strong>portal.test2.org</strong></p>
  
  <p>Could someone direct me on the following</p>
  
  <p>a. How nginx decides which site to return when it does not exist as a virtual host
  b. How to catch any domain that are not specified and return a default page that tells users this domain does not exist on this host</p>
  
  <p>Hope someone can help I have tried googling but I think sometimes its knowing the correct terms.</p>
  
  <p>Many thanks</p>