Is it possible to somehow add arbitrary HTTP response headers to the "stats" pages in HAProxy? haproxy version 1.7.x.
Regular stats setup:
listen view
bind *:10002
stats enable
stats uri /
stats hide-version
Customizing and trying to add headers makes no difference.
This does not work, i.e. no X-Frame-Options header is added to the response:
listen view
bind *:10002
rspadd X-Frame-Options:\ SAMEORIGIN
stats enable
stats uri /
stats hide-version
Nor does this work:
listen view
bind *:10002
http-response set-header X-Frame-Options SAMEORIGIN
stats enable
stats uri /
stats hide-version
The exact same parameters in a "regular" listen block works like a charm.
stats
apparently aren't processed by http code, sohttp-request
don't work. It even has its ownstats http-request
with very limited functionality (https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#4.2-stats%20http-request).Putting proxy in front of it should work:
Tested on haproxy 2.1, by it should work for 1.7 as well.