Quantcast
Channel: Serverphorums.com - HAProxy
Viewing all articles
Browse latest Browse all 5112

case @req.hdr puzzlement (2 replies)

$
0
0
I'm trying to add a header only if the last occurrence of it is not
the frontend_name (%f), but the header field name comparison seems to
be case sensitive when it should not be ?

haproxy.cfg
========
listen foo.bar
bind :10001
mode http
log 127.0.0.1:514 local2 debug info

acl XOH_OK req.hdr(X-Orig-Host,-1) -m str -i %f
http-request add-header X-Orig-Host %f unless XOH_OK
# http-request add-header X-Orig-Host %f if !{
req.hdr(x-orig-host,-1) -m str -i %f }

capture request header X-Orig-HoST len 64

server local localhost:80

curl test
=======
curl -I -H 'X-Orig-Host: baz' -H 'x-oRiG-hOsT: foo.bar' -H 'Host:
foo.bar' localhost:10001/

headers as seen by lighttpd
=================
2016-03-18 14:45:26: (request.c.311) fd: 7 request-len: 135
HEAD / HTTP/1.1
User-Agent: curl/7.38.0
Accept: */*
X-Orig-Host: baz
x-oRiG-hOsT: foo.bar
Host: foo.bar
X-Orig-Host: foo.bar

haproxy with this config should *not* have added the last header ???

System:
root@jfree:~# haproxy -v
HA-Proxy version 1.6.3 2015/12/25Debian Jessie, haproxy from backports
https://packages.debian.org/jessie-backports/haproxy

BTW - haproxy well and truly rocks ...

Viewing all articles
Browse latest Browse all 5112

Trending Articles