title: Nginx Load Balancing Upstream proxy
body: <p>I need some help in nginx Load balancing.
  I have a docker instance which is serving a static web page, which have two containers for that
  Let say
  192.168.1.1:8081 -> serving a static page 
  192.168.1.1:8082 -> serving same static page</p>
  
  <p>Now what i want is to load balance these two sites with Nginx.
  when i enter these IP address 192.168.1.1 ,these Ip have to serve the load between my two sites.</p>
  
  <p>In my Nginx i have to set two files for that</p>
  
  <p>Nginx.conf ,in these file I have to include my default.conf file .
  default.conf file has the following information.</p>
  
  <pre><code>upstream mynewsite {
  
          server 192.168.1.1:8081;
          server 192.168.1.1:8082;       
  }
  
  server {
  listen 80; # I tried by commenting with these also
  server_name  192.168.1.1;
  #server_name mynewsite; # I tried like this also
  index index.htm index.html index.php; 
  access_log /var/log/nginx/access.log ;
  error_log /var/log/nginx/error.log;
  
  location / {
          proxy_pass http://mynewsite;
          }
  </code></pre>
  
  <p>when I type 192.168.1.1:8081 , I am able to access the page from my first docker container.
  And when I type 192.168.1.1:8082 , I am able to access the page from my second docker container.</p>
  
  <p>But when I type 192.168.1.1 , I am unable to access the page.</p>
  
  <p>I am using Centos 6.8 and nginx version: nginx/1.10.2, 
  Docker version 1.7.1
  Tomcat application server on my docker container.
  Note://192.168.1.1 is not the exact ip, I used some other Ip
  Any Suggestions to fix this issue.
  Thanks,
  Ganesh</p>