Is it possible to have a path appended (like the requirep below) but on a per server basis ? I can't see how it is possible in 1.3 or 1.4. There is redir, but redir does a HTTP redirect, not what I need.

backend something.abc.com 
  reqirep ^([^\ \t])(.*)[\ \t]/(.*) \1\2\ /businessGov/pad/businessgov.html\3
  server node1 someserver1:80 cookie node1  check
  server node1 someserver2:80 cookie node2  check

No it's not possible, because the HTTP rewriting is performed before selecting the server. And if the connection to the server failed we'd have to retry on another one, possibly reprocessing what has already been done over and over, which surely is not what you want.

Keep in mind that haproxy is a load balancer. The servers are then assumed to be doing the same thing and to receive equivalent requests. Otherwise you're more talking about independant farms that could be materialized in distinct backends with distinct rules.

  • yep - on reading the haproxy source I realised that it wouldn't be possible (its pretty neat source !). I was interested as nginx proxying refer to backends via full URL - not via server:port – Michael Neale Oct 13 '10 at 5:24
  • But this is unrelated. Nginx will receive the original unmodified request for the valid host and with its full URL. You must not have your servers bound to their own hostname but to the public hostname. – Willy Tarreau Dec 10 '10 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.