Sure.

I have a setup where we're using HAProxy to front hundreds of different
services, each service running on a different port.

I can figure out from the request (for example, the SNI information), which
service we want to use.  However, for maintenance of the haproxy config
file,
it's very desirable to not have several hundred back-ends.

A frontend, with a server configuration with a dynamically chosen port seems
ideal.  It would be the logical equivalent of

    server svc1 host:1001 if svc_1
    server svc2 host:1002 if svc_2

etc.

Thanks,

On Tue, May 10, 2016 at 2:53 PM, Baptiste <bed...@gmail.com> wrote:

> On Tue, May 10, 2016 at 8:13 PM, Derek Brown <derekwbr...@gmail.com>
> wrote:
> > Hello-
> >
> > I am trying to write a configuration which will allow me to choose the
> > back-end port dynamically.
> >
> > Specifically, I'd like to listen on port 443, and then choose the backend
> > port based on an http header
> > in the request.  Something like
> >
> > frontend myserver
> >     bind 443
> >     mode http
> >
> >     server real-server 192.168.1.1:req.hdr(X-My-Header)
> >
> > --OR--
> >    server realserver 192.168.1.1:%[req.ssl_sni,lower,map(mapfile)]
> >
> >
> > where mapfile contains
> > hosta.domain.com 1001
> > hostb.domain.com 1002
> >
> > or similar.
> >
> > Is there any facility which would allow this, including the new(er) Lua
> > capabilities?
> >
> > Thanks, in advance
>
>
> Hi Derek,
>
> Could you please explain us your use case?
>
> Baptiste
>

Reply via email to