Joined June 2012
·

Sebastian Łach

Software Engineer at Tokenizer
·
Cracow
·
·

Like sqlbot have mentioned it seems like acls are being evalutated on each reference that's why it's not working. I have a dirty workaround for that but at least it's working in haproxy 1.5+

http-request add-header X-Host-Redirect yes if { hdr_beg(host) -i www. }
acl host_redirect hdr_cnt(X-Host-Redirect) eq 1
reqirep ^Host:\ www.(.*)$ Host:\ \1 if host_redirect
redirect scheme https if host_redirect