title: How do I setup nginx for multiple upstream and load balancing?
body: <p>I am new to nginx config and I am trying to set up a <strong>reverse proxy</strong> using nginx and want to use <strong>load balancing of nginx</strong> to equally distribute the load on the two upstream servers of the upstream custom-domains i.e<br>
  server 111.111.111.11;
  server 222.222.222.22;.</p>
  
  <p>Shouldn't the distribution be round robin by default?
  I have tried weights, no luck yet.
  This is what my server config looks like:</p>
  
  <pre><code>upstream custom-domains {
      server 111.111.111.11;
      server 222.222.222.22;
  }
  upstream cert-auth {
      server 00.000.000.000;
  } 
  server {
      listen       80;
      server_name  _;
  
     #access_log  /var/log/nginx/host.access.log  main;
  
      location / {
          proxy_pass http://custom-domains;
          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;
      }
      location /.well-known/ {
          proxy_pass http://cert-auth;
      }
  }
  </code></pre>
  
  <p>Right now all the load seems to be redirecting to just the first server i.e. 111.111.111.11. </p>
  
  <p>Help is greatly appreciated! Thanks again.</p>