Hi,

I want HAProxy to add a response header if request includes a specific
header. I implemented the logic [1] but I get the following

 parsing [/etc/haproxy/haproxy.cfg:77] : acl 'lb_debug' will never match
because it only involves keywords that are incompatible with 'frontend
http-response header rule'
[WARNING] 331/135906 (6390) : config : log format ignored for proxy
'haproxy' since it has no log address.

Found few references on Internet and if I understood them correctly it
fails because at the moment rspadd is evaluated HAProxy doesn't know
request information like headers. Am I right? and if I am right , do we
have solution?  Willy mentioned in a similar thread about a dirty way to
get it but I failed to find it.

[1]
frontend foo_bar_com
    capture request header User-Agent len 120
    capture request header Host       len 32
    bind 10.189.200.1:80
    acl lb_debug req.hdr(LBBEBUG) -i true
    rspadd LBNODENAME:\ haproxylb-201.lhr4.qds.booking.com if lb_debug
    default_backend foo_bar_com

backend foo_bar_com
    default-server inter 10s
    option httpchk GET / HTTP/1.1\r\nHost:\ foo.bar.com
<http://graphite.booking.com>\r\nUser-Agent:\ HAProxy
    server server1 10.12.10.65:80 <http://10.196.70.65:80> check



Cheers,
Pavlos

Reply via email to