Setting a http-response header with redirect

Running HAProxy version 1.7.5-2~bpo8+1 on Debian 8

What I’m trying to do is add HTTP headers with a http-request redirect to the response sent to the client. Above the http-request redirect I have http-response set-header Strict-Transport-Security 'foo bar', but the header is not set in the 302 response.

Thanks

https://www.mail-archive.com/haproxy@formilux.org/msg25061.html

This works but it’s kind of ugly. Maybe someone should add an option to http-request redirect that adds a header?

1 Like

I don’t think that workaround will work with http/2. It’s possible to do it with a lua applet (with register_service), but it’s still not pretty.