[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haproxy
Subject:    Re: reqrep with a match/backref into Host: header?
From:       Baptiste <bedis9 () gmail ! com>
Date:       2014-02-28 12:54:52
Message-ID: CAODHi7rU+eiMYGUc=Kn8k+vwuOF48ZZet++8Kjg8zQzQ56hHbA () mail ! gmail ! com
[Download RAW message or body]

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
<e1c1bac6253dc54a1e89ddc046585792@posteo.net> 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
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic