I'm trying to set up HAProxy such that it picks a backend based on a header value. But I also want to hide that header from backends.
My config:
defaults
mode http
timeout connect 5s
timeout client 5s
timeout server 5s
listen lb
bind *:1234
balance hdr(Proxy-Authorization)
# http-request del-header Proxy-Authorization
server srv1 192.0.2.1:8080
server srv2 192.0.2.2:8080
server srv3 192.0.2.3:8080
With this config Proxy-Authorization
is passed down to backends, which I wanted to avoid. If I uncomment http-request del-header Proxy-Authorization
it disappears, but also balance hdr(Proxy-Authorization)
can no longer see it and starts just doing round-robin.
Is it possible to balance based on a header value and hide it from the backend at the same time?