In HAProxy (1.5) I have this rule to redirect all requests to a canonical domain:
redirect prefix https://domain.tld code 301 unless { hdr(host) -i domain.tld }
This works fine. However, I also have stats enabled (stats uri /haproxy-stats
). For these I would like to disable the redirect as I need to access specific haproxy machines (they are behind a DNS round-robin) through their own host name.
Is there any way of configuring HAProxy in such a way?