%[] in use-server directives

2019-02-18 Thread Joe K
Hello everyone! I wonder if there is a way to use %[...] syntax in use-server directives. backend be_template server-template websrv 1-100 localhost: check disabled use-server %[req.hdr(host),lower,map_dom(/usr/local/etc/haproxy/domain2server.map,websrv0)] if { req.hdr(host),lower

Re: %[] in use-server directives

2019-02-18 Thread Joe K
e K wrote: > Hello everyone! > > > I wonder if there is a way to use %[...] syntax in use-server directives. > > > backend be_template > server-template websrv 1-100 localhost: check disabled > use-server > %[req.hdr(host),lower,map_dom(/usr/local/etc/

Re: %[] in use-server directives

2019-02-18 Thread William Lallemand
nder if it would be useful to anyone > beside me? > > On Mon, Feb 18, 2019 at 5:25 PM Joe K wrote: > > > Hello everyone! > > > > > > I wonder if there is a way to use %[...] syntax in use-server directives. > > > > > > backend be_template > >

Re: %[] in use-server directives

2019-02-19 Thread Willy Tarreau
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 de

Re: %[] in use-server directives

2019-02-19 Thread Joe K
> 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. > > > > Ho

Re: %[] in use-server directives

2019-02-19 Thread Willy Tarreau
Hi Joe, On Tue, Feb 19, 2019 at 08:45:48AM +, Joe K wrote: > 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 wi

Re: %[] in use-server directives

2019-02-19 Thread Joe K
I have next to zero experience with C but the commit 702d44f seems to be small enough for me to be able to wrap my head around. I'll try making it work for use-server tomorrow! Thank you! On Tue, Feb 19, 2019 at 8:57 AM Willy Tarreau wrote: > Hi Joe, > > On Tue, Feb 19, 2019 at 08:45:48AM +

Re: %[] in use-server directives

2019-02-19 Thread Willy Tarreau
On Tue, Feb 19, 2019 at 09:14:40AM +, Joe K wrote: > I have next to zero experience with C but the commit 702d44f seems to be > small enough for me to be able to wrap my head around. > > I'll try making it work for use-server tomorrow! Thank you! Ah great, thanks for this! Do not hesitate to

Re: %[] in use-server directives

2019-02-19 Thread Joao Morais
> Em 19 de fev de 2019, à(s) 05:57, Willy Tarreau escreveu: > > In the past it was not possible > to dynamically create servers I think I misunderstood something, but... how do one dynamically create a new server?

Re: %[] in use-server directives

2019-02-19 Thread Bruno Henc
Hi, The following links should be able to help you out: https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/#dynamically-scaling-backend-servers https://www.haproxy.com/blog/dynamic-scaling-for-microservices-with-runtime-api/#runtime-api You might need to build a developmen

Re: %[] in use-server directives

2019-02-19 Thread Baptiste
On Tue, Feb 19, 2019 at 9:54 PM Bruno Henc wrote: > Hi, > > > The following links should be able to help you out: > > > https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/#dynamically-scaling-backend-servers > > > https://www.haproxy.com/blog/dynamic-scaling-for-microservices-

Re: %[] in use-server directives

2019-02-20 Thread Joao Morais
> Em 19 de fev de 2019, à(s) 17:51, Bruno Henc escreveu: > > On 2/19/19 9:45 PM, Joao Morais wrote: >> >>> Em 19 de fev de 2019, à(s) 05:57, Willy Tarreau escreveu: >>> >>> In the past it was not possible >>> to dynamically create servers >> I think I misunderstood something, but... how do

Re: %[] in use-server directives

2019-02-21 Thread Joe K
Hello everybody again ... So here's what I have right now, just from copy-pasting and slightly editing 702d44f. The config check passes, but haproxy crashes with segmentation fault after the first request with an enabled server. On Tue, Feb 19, 2019 at 9:24 AM Willy Tarreau wrote: > On Tue, Fe

Re: %[] in use-server directives

2019-02-21 Thread Willy Tarreau
Hi Joe, On Thu, Feb 21, 2019 at 08:23:29AM +, Joe K wrote: > Hello everybody again ... > > So here's what I have right now, just from copy-pasting and slightly > editing 702d44f. > > The config check passes, but haproxy crashes with segmentation fault after > the first request with an enable

Re: %[] in use-server directives

2019-02-21 Thread Joe K
Ah, I see. Tried it, but it seems it's not the only thing that causes the segfault. On Thu, Feb 21, 2019 at 8:31 AM Willy Tarreau wrote: > Hi Joe, > > On Thu, Feb 21, 2019 at 08:23:29AM +, Joe K wrote: > > Hello everybody again ... > > > > So here's what I have right now, just from copy-past

Re: %[] in use-server directives

2019-02-28 Thread Willy Tarreau
On Wed, Feb 20, 2019 at 10:43:22AM -0300, Joao Morais wrote: > Hi Bruno, thanks! Updating servers via api I'm currently using. From Willy > "in the past it was not possible to dynamically create servers" - so now I'm > wondering if there is a way or future plan to create a new server on an > existi