title: HAProxy dynamic server addresses
body: <p>We have Similar setup to this diagram</p>
  
  <p><a href="https://i.stack.imgur.com/bgt0F.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bgt0F.png" alt="enter image description here"></a></p>
  
  <p>Where request arrives to HAProxy, it get's roundrobin balanced to any servers, backend server checks its cache and if resource is not on that server it issues redirect with header set to the correct server IP.</p>
  
  <p>Second time request arrives to HAProxy, it detects that the header with backend server is there, but how can I take that IP and direct request directly to it?</p>
  
  <p>For example, second time request arrives to haproxy it has header <code>X-BACKEND-IP=10.0.0.5</code></p>
  
  <p>So instead haproxy trying to load balance that request, I want it to read the header, take that IP and go directly to that backend.</p>
  
  <p>Is that possible? If not, would it be possible with nginx ?</p>