title: Does the nginx "upstream" directive have a port setting?
body: <p>I use <code>upstream</code> and <code>proxy</code> for load balancing.</p>
  
  <p>The directive <code>proxy_pass http://upstream_name</code> uses the default port, which is 80.</p>
  
  <p>However, if the upstream server does not listen on this port, then the request fails.</p>
  
  <h2>How do I specify an alternate port?</h2>
  
  <p>my configuration:</p>
  
  <pre><code>http{
  #...
  upstream myups{
   server 192.168.1.100:6666;
  server 192.168.1.101:9999;
  }
  #....
  server{
  listen 81;
  #.....
  location ~ /myapp {
   proxy_pass http://myups:81/;
  }
  }
  </code></pre>
  
  <p>nginx -t:</p>
  
  <pre><code>[warn]: upstream "myups" may not have port 81 in /opt/nginx/conf/nginx.conf:78.
  </code></pre>