title: haproxy reverse proxy directing randomly
body: <p>The reverse proxy of <code>mydomain.com</code> is working, but the subdomain <code>fela.mydomain.com</code> seems to be randomly picking between <code>172.17.0.59:8080</code> and <code>172.17.0.50:8080</code>.</p>
  
  <pre><code>global
      log 127.0.0.1   local0
      log 127.0.0.1   local1 notice
      chroot /var/lib/haproxy
      stats socket /run/haproxy/admin.sock mode 660 level admin
      stats timeout 30s
      user haproxy
      group haproxy
      daemon
  
  defaults
      log global
      mode    http
      option  httplog
      option  dontlognull
          timeout connect 5000
          timeout client  10000
          timeout server  10000
  
  listen stats
      # Uncomment "disabeled" below to disable the stats page :
      # disabled
      bind       :1988
      stats uri /
  
  frontend http-in
          bind *:80
  
          # Define hosts
          acl host_fela           hdr(host) -i fela.mydomain.com
          acl host_mydomain       hdr(host) -i mydomain.com
  
          ## figure out which one to use
          use_backend mydomain_cluster       if host_mydomain
          use_backend fela_cluster           if host_fela
  
  backend mydomain_cluster
          balance leastconn
          option httpclose
          option forwardfor
          cookie JSESSIONID prefix
          server node1 172.17.0.50:8080 cookie A check
  
  backend fela_cluster
          balance leastconn
          option httpclose
          option forwardfor
          cookie JSESSIONID prefix
          server node1 172.17.0.59:8080 cookie A check
  </code></pre>