Perhaps this is more what you are looking for? https://github.com/smarterclayton/haproxy-map-route-example
On Thu, Apr 30, 2015 at 11:43 AM, Veiko Kukk <vk...@xvidservices.com> wrote: > I'd like to manually add that constant string into configuration, not to > get it from the traffic. It would help to reduce differences in haproxy > configuration file between server groups and easier migration between > groups. > > Best regards, > Veiko > > > On 30/04/15 18:06, Baptiste wrote: > >> On Thu, Apr 30, 2015 at 11:49 AM, Veiko Kukk <vk...@xvidservices.com> >> wrote: >> >>> Hi everybody >>> >>> I'd like to simplify my haproxy configuration management by using almost >>> identical configurations for different groups of haproxy installations >>> that >>> use different backends based on string comparision. The only difference >>> in >>> haproxy configuration files of different groups would be that string. >>> >>> The configuration logic would be something like this (not syntactically >>> correct for haproxy, I know, but should show what I wish to accomplish): >>> >>> constant = foo # first hostgroup configuration >>> constant = bar # second hostgroup configuration >>> >>> # common configuration for all hostgroups >>> use_backend ha_backend_foo if constant == foo >>> use_backend ha_backend_bar if constant == bar >>> ... >>> >>> I wonder how to specify that string and form acl to use in 'use_backend' >>> statement? >>> >>> Thanks in advance, >>> Veiko >>> >> >> >> Hi Veiko, >> >> The question is how do you set your constant, what piece of >> information do you use from the traffic or whatever? >> Then we may help you. >> >> Baptiste >> >> >