Hi Willy! My use case is very similar to gitlab's review apps: https://gitlab.com/help/ci/review_apps/index.md, on some PRs I want to be able to start web apps each with its own subdomain which would register themselves with haproxy via a socket like this (I thought):
``` set server be_template/websrv<i> addr <app_host> port <app_port> set server be_template/websrv<i> state ready add map /usr/local/etc/haproxy/domain2server.map <COMMIT_REF_SLUG>. domain.com websrv<i> ``` I've also described my use case on the forum: https://discourse.haproxy.org/t/in-use-server/3529 On Tue, Feb 19, 2019 at 8:39 AM Willy Tarreau <[email protected]> wrote: > Hi guys, > > On Mon, Feb 18, 2019 at 08:20:03PM +0100, William Lallemand wrote: > > > > I wonder if there is a way to use %[...] syntax in use-server > directives. > (...) > > Indeed it's not possible to parse a log-format string there. > > > > However, you can set dynamically the destination IP with 'http-request > set-dst' > > and '0.0.0.0:0' as a server address. That's an ugly trick and that > might be > > difficult to read logs and statistics when doing it because it will use > the > > same server. > > When we added use-server, I've wondered if it would be useful to have > this dynamic server selection rule or not, and by then I found it > useless. But I'm well aware that use cases have evolved over the last > years, and it could be possible that this decision would need to be > revisited. Joe, what is your use case, out of curiosity ? It's always > important for us to have a compelling use case in mind to implement > long-standing features without the fear of creating another thing we > may later regret. > > Thanks, > Willy >

