title: HAproxy: digest authentication
body: <p>We have setup a loadbalancer to balance 2 servers. The config looks like this:</p>
  
  <blockquote>
    <p>global<br />
        maxconn 40960<br />
        user haproxy<br />
        group haproxy<br />
        daemon<br /></p>
    
    <p>defaults<br />
        log     global<br />
        option  dontlognull<br />
        retries 3<br />
        timeout client 10s<br />
        timeout server 10s<br />
        timeout connect 4s<br />
        maxconn 40960<br /></p>
    
    <p>listen webpool lbIP:80<br />
        mode http<br />
        cookie SERVERID insert indirect<br />
        balance roundrobin<br />
        server slave1 slave1IP:80 cookie A check port 8981<br />
        server slave2 slave2IP:80 cookie B check port 8982<br /></p>
  </blockquote>
  
  <p>The servers slave1 and slave2 needs digest authentication. When the client sends a request the first request is balanced to slave1. This returns a 401: Unauthorized. The second request is balanced to slave2 and will succeed, it returns a 200: OK. The problem is that the authentication always happens on slave1 and the the response always came from slave2. I want both requests(authentication and returning data) into one connection/slave.</p>
  
  <p>Is it possible to configure this in HAproxy?</p>
  
  <p>Thanks John</p>