title: Nginx multi-domain and multi-app with tomcat usage
body: <p>I am trying to use one nignx server to proxy multi-app running in tomcat:</p>
  
  <pre><code>a.example.com -&gt;192.168.1.101:8080/ps and 192.168.1.102:8080/ps
  b.example.com -&gt;192.168.1.102:9080/ir
  </code></pre>
  
  <p>Here is my nginx.conf.It seems not work.Please help me.Thanks</p>
  
  <pre><code>upstream ps {
      server 192.168.1.101:8080 weight=2;
      server 192.168.1.102:8080 weight=3;
      }
  
    upstream ir {
          server 192.168.1.102:9080;
      }
  server {
          listen       80;
          server_name  a.example.com;
          location /{
          proxy_pass http://ps/ps;
          }
      }
      server{
          listen  80;
          server_name b.example.com;
          location /{
              proxy_pass http://ir/ir;
          }
      }
  </code></pre>