title: Multiple websites in one VPS instance with NGINX
body: <p>I still struggling with configuration of nginx for multiple websites in one virtual machine.
  So If I do:</p>
  
  <pre><code>server {
      listen 80;
  
      server_name example1.com;
  
      location / {
          proxy_pass http://localhost:8181;
          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>after hit example1.com my nodejs page is loaded properly. But If I try to add second server block:</p>
  
  <pre><code>server {
      listen 80;
  
      server_name example2.com;
  
      location / {
          proxy_pass http://localhost:8080;
          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>Nothing is working, also example1. So I wanna to load through example2.com default nginx location... Something like that:</p>
  
  <pre><code>server {
      listen 80;
  
      server_name example1.com;
  
      location / {
            root /usr/share/nginx/html;
            index index.html index.htm;
      }
  }
  
  server {
      listen 80;
  
      server_name example2.com;
  
      location / {
          proxy_pass http://localhost:8181;
          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>But it is always redirected to nginx root location.</p>
  
  <p>How can I do that? Thanks for any help!</p>