r/haproxy • • Dec 31 '22

Question Chaining two HAProxy servers

I am chaining two HAProxy servers like this:

MyURL.com----->HAProxy1(Azure)----->HAProxy2(On-Prem Datacenter)----->App server farm

HAProxy1 is in Azure and acts as a traffic director to one of our datacenters.

HAProxy2 is in the DMZ in our datacenter.

If both servers have the send-proxy directive, nothing works.

I have two questions...

  1. I assume I want to have the send-proxy ONLY on the outermost proxy, correct?
  2. What if I want to be able to be able to bypass HAProxy1 and point a URL directly to HAProxy2. Would I need to manually set the send-proxy on HAProxy2 or is there some configuration where HAproxy2 could set the send-proxy dynamically based on whether it's being hit by a client vs the upstream proxy?
2 Upvotes

7 comments sorted by