Hi,

I would like to replace incoming request's User Agent with a custom one
before it reaches the destination server.

Here is the incoming User Agent :

Mozilla/5.0 (;;;) AppleWebKit/534.6 HbbTV/1.1.1 (+DL+PVR; television;
Television EMC1000i; 1.0; 1.0;) hdplusinteraktiv/1.0 (NETRANGEMMH;)
CE-HTML/1.0

and there is the target one :

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0

I wrote the following configuration (not complete) :

listen stb 0.0.0.0:80
....
acl inverto_acl hdr(User-Agent) -i AppleWebKit
use_backend inverto if inverto_acl

backend inverto
        http-request set-header user-agent Mozilla/5.0....
        server  octop1 193.33.168.14:80 check inter 2000 fall 3
...

and a lot of combinations for target User Agent but haproxy generates an
error each time. I read on the manual that I have to use a "fmt" format but
I can not find out how to translate the User Agent I wand to use into
something suitable for haproxy.

BTW is the acl well formatted to trigger on the incoming User Agent ?

Regards

Jérôme

Reply via email to