Hi Philipp,
You can't do this in current HAProxy.
That said, it may happen soon, since the you can already use some
header values in the http-request rules:
IE:
http-request redirect code 301 location www.%[hdr(host)]%[req.uri]
unless { hdr_beg(host) -i www }
Note: I tried to use this syntax with reqirep and it does not work ;)
Baptiste
On Fri, Feb 28, 2014 at 12:35 PM, Philipp
<[email protected]> wrote:
> Hi,
>
> current functional setup:
> frontend f
> acl ssfc_dev hdr(host) -m str dev.example.com
> acl ssfc_img hdr(host) -m str img.example.com
> [..]
> reqrep ^GET[\ \t]*/(.*) GET\ /dev.example.com/\1 if ssfc_dev
> reqrep ^GET[\ \t]*/(.*) GET\ /img.example.com/\1 if ssfc_img
>
> the backend webserver treats that accordingly.
> So far so good.. but given that this list will grow over time, it'll be a
> bit of a pain to manage this.
>
> Is there any way to make that happen by dynamic matches instead of a 1:1
> acl/reqrep pairing?
> Generating such a config isnt that much of a problem, but it lacks elegancy
> in my eyes ;-)
>
> TIA
>