I’m trying to setup a simple multi-layered haproxy setup to mimic a real-world issue with some devices with each proxy adding a proxy protocol header to the first packet as it goes through.
However, I’ve been quite unsuccessful trying to mimic that. The second proxy receives the packet with a proxy header but as it sends out its own header, it strips out the old header. Is there a way one can persist both the headers when the packet reaches the backend?
These are my config.
This is for proxy1. This receives the request from the client and proxies it to another proxy.
global
defaults
timeout client 30s
timeout server 30s
timeout connect 30s
frontend MyFrontend
bind 0.0.0.0:80
default_backend TransparentBack_http
backend TransparentBack_http
mode http
server Proxy 172.18.0.3:80 check send-proxy
This is for proxy2. This handles the connection from proxy1 and sends it to the server.
global
defaults
timeout client 30s
timeout server 30s
timeout connect 30s
frontend MyFrontend
bind 0.0.0.0:80
default_backend TransparentBack_http
backend TransparentBack_http
mode http
server WebServer 172.18.0.2:80 check send-proxy-v2