Ivan Kurnosov
2018-10-14 20:39:56 UTC
I have the following config, it's under the `frontend` section for tls
connection and haproxy terminates https connections:
acl domain-acl-host hdr(host) -i domain.tld
rspadd X-Foo:\ bar if domain-acl-host
rspadd X-Baz:\ baz
http-response set-header X-Bar bar if domain-acl-host
use_backend backend_name if domain-acl-host
The `use_backend` directive works conditionally as expected (there are
multiple different domain names served, and they are chosen correctly)
But headers are not added/set to the response conditionally.
I expect 3 extra headers to be added there: `X-Foo`, `X-Baz`, and `X-Bar`,
but only `X-Baz` is added:
< HTTP/1.1 302 Found
< Server: nginx
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Cache-Control: max-age=0, must-revalidate, private
< Date: Sun, 14 Oct 2018 20:25:59 GMT
< Location: https://domain.tld/somewhere/else
< X-Baz: baz
I'm sure I'm missing something trivial, but reading documentation or google
did not help.
PS: it's `haproxy 1.8.8`
PPS: I originally asked it at https://serverfault.com/q/935492/45086 as well
connection and haproxy terminates https connections:
acl domain-acl-host hdr(host) -i domain.tld
rspadd X-Foo:\ bar if domain-acl-host
rspadd X-Baz:\ baz
http-response set-header X-Bar bar if domain-acl-host
use_backend backend_name if domain-acl-host
The `use_backend` directive works conditionally as expected (there are
multiple different domain names served, and they are chosen correctly)
But headers are not added/set to the response conditionally.
I expect 3 extra headers to be added there: `X-Foo`, `X-Baz`, and `X-Bar`,
but only `X-Baz` is added:
< HTTP/1.1 302 Found
< Server: nginx
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Cache-Control: max-age=0, must-revalidate, private
< Date: Sun, 14 Oct 2018 20:25:59 GMT
< Location: https://domain.tld/somewhere/else
< X-Baz: baz
I'm sure I'm missing something trivial, but reading documentation or google
did not help.
PS: it's `haproxy 1.8.8`
PPS: I originally asked it at https://serverfault.com/q/935492/45086 as well
--
With best regards, Ivan Kurnosov
With best regards, Ivan Kurnosov