title: how to hosting multiple Nodejs applications with nginx
body: <p>I understand that multiple node.js can be run on one server using Nginx. I've got Nginx setup and running on a Ubuntu server. I have two node js applications : <pre><code>
      127.0.0.1:3001</code> and <code>
      127.0.0.1:3002</code></pre>. I want to access the different application with different url. For example, if I want access <pre><code>
      127.0.0.1:3001</code></pre>, I would use url: <pre> <code>http://121.42.20.100/</code></pre>. And if want access the application of <pre><code>
      127.0.0.1:3002</code></pre>, I would use url:<pre> <code>http://121.42.20.100/admin</code> </pre>
  the default file on the folder sites-available follows :</p>
  
  <pre>
  
      server {
              #listen   80; ## listen for ipv4; this line is default and implied
              #listen   [::]:80 default ipv6only=on; ## listen for ipv6
  
              root /usr/share/nginx/www;
              index index.html index.htm;
  
              # Make site accessible from `    http://localhost/`
              server_name 0.0.0.0;
  
              location / {
  
                     proxy_pass `    http://127.0.0.1:3001`;
  
              }
  
              location /admin/ {
                      proxy_pass `    http://127.0.0.1:3002`;
              }
      }
  
  </pre>
  
  <p>When I access url like <pre><code>http://121.42.29.100/</code></pre>, it works that get response from <pre> 
      127.0.0.1:3001</pre>. However, when I access url like <pre><code>http://121.42.29.100/admin</code></pre>, it does not work that it shows error of "Cannot GET /admin/". How can I configure the nginx to get it work?</p>