I've got a web farm set up something like this:
|-------------------> Apache1 | HAProxy -| | |-------------------> Apache2
HAproxy has external IP x.x.x.x
Apache1 has 2 interfaces: internal y.y.y.y (for requests from HAProxy), and external IP z.z.z.z
Apache2 has 2 interfaces: internal yy.yy.yy.yy (for requests from HAProxy), and external IP zz.zz.zz.zz
Anytime I make requests outside the farm from one of the apache servers (such as a curl request in php to say, google.com), the REMOTE_ADDR header is the external IP of the apache server making the call (yy.yy.yy.yy or zz.zz.zz.zz).
The problem is, some of the servers I make such requests to limit the IPs requests from. Ideally I'd like to provide them the IP of the HAProxy server (x.x.x.x), instead of having to give them the IPs of the 2 backend servers.
Is there any way to accomplish this in configuring either apache or haproxy?