title: To test Nginx load-balancing in local system
body: <p>I wanted to test if nginx is redirecting to node-2 if node-1 is down. </p>
  
  <p>For that, I installed tomcat in my local windows machine and started 2 instances in <code>8080</code> and <code>9090</code> port</p>
  
  <p><strong>Dont know how to configure nginx for this.</strong> I tested by adding below blocks in nginx.conf . But still it is not working for me. Please help me on this</p>
  
  <pre><code>proxy_redirect ~.*:909[0-9]/(.*)$ /$1;
  proxy_redirect ~.*:808[0-9]/(.*)$ /$1;
  
  upstream localhost {
  
          server localhost:8080;
          server localhost:9090;
      }
  
  
  server {
          listen 8080;
          server_name localhost;
  
      }
  </code></pre>