title: HAproxy port 80 and 443 to backend:80 and backend:443
body: <p>How can I improve on the following config, to get haproxy to listen on port 80 and 443 and pass requests to backend:80 or backend:443 depending.</p>
  
  <p>Is there a better way to do this?</p>
  
  <pre><code>frontend http
      bind    35.154.100.100:80
      default_backend http_nginx_pool
  
  frontend https
      bind    35.154.100.100:443
      default_backend https_nginx_pool
  
  backend http_nginx_pool
      mode tcp
      server nginx2 10.233.32.143:80 check
  
  backend https_nginx_pool
      mode tcp
      server nginx2 10.233.32.143:443 check
  </code></pre>