Hi Pieter, On Thu, Jan 25, 2018 at 3:15 AM, Pieter Vogelaar <pie...@pietervogelaar.nl> wrote:
> I have the following configuration: > > > > > > frontend default-tcp > > bind 192.168.52.12:5044 > > bind 192.168.52.12:5555 > > bind 192.168.52.12:5556 > > bind 192.168.52.12:5672 > > bind 192.168.52.13:5672 > > mode tcp > > option tcplog > > use_backend %[dst_port,map(/etc/haproxy/tcp-bindings-to-backends.map, > default)] > > > > > > The map file (/etc/haproxy/tcp-bindings-to-backends.map) looks like: > > > > > > 192.168.52.12:5044 logging-logstashmsg-acc > > 192.168.52.12:5555 logging-logstashmsg-acc > > 192.168.52.12:5556 logging-logstashmsg-acc > > 192.168.52.12:5672 logging-rabbitmq-acc > > 192.168.52.13:5672 stackstorm-rabbitmq-tst > > > > > > I would like to route based on the IP address and port to the correct > backend. At the moment I used the dst_port sample on the use_backend line. > But that must be a concatenation of dst sample, “:” and dst_port sample. > > It seems like a basic thing to do, but I just can’t figure out how to do > this. > > > How do you access the frontend? If via ip:port instead of dns than I guess the ip:port combo will already be present in the hdr(host).