I’m trying to setup a HAProxy loadbalancer for microservices. Is it possible to make the SRV record reference in a server-template dynamic, ex. path-based? So that the request in the frontend can be used in choosing the SRV record. Might this be possible with LUA? Now I have to define a backend for each service separately everytime and reload HAProxy.
Config would look like:
backend api
server-template api 1-2 _%[path]._tcp.services.internal check resolvers dns_resolver init-addr none