@jbrahy wrote:
I’m looking for the equivalent of this code block below for requests to www.example.com and example.com. Can I do string concatenation like this?
http-response set-header X-Target example.com server web-servers site.example.com:80 check
This is what I want to try. I just want to know if I’m crazy.
http-response set-header X-Target %[req.hdr(Host)] server web-servers site.%[req.hdr(Host),regsub(^www.,,)]:80 check
HA-Proxy version 1.8.12-8a200c7 2018/06/27
I’m getting this error when I try haproxy -c -f haproxy.test
[root@pm-prod-haproxy05 haproxy]# haproxy -c -f haproxy.test
[ALERT] 259/180932 (16116) : parsing [haproxy.test:40]: ‘http-response set-header’: sample fetch <req.hdr(Host)> may not be reliably used here because it needs ‘HTTP request headers’ which is not available here.
[ALERT] 259/180932 (16116) : Error(s) found in configuration file : haproxy.test
[root@pm-prod-haproxy05 haproxy]#
Posts: 1
Participants: 1