I don’t mean to drag this thread up from the dead, but I have the same use case as curtoni, and I’m not sure that the solution that @ahayworth proposed is working properly. I’m using the following configuration on my testing instance:
# Some configuration options are redacted - the actual configuration is perfectly valid except for this issue.
global
lua-load /root/nexus_route.lua
defaults
mode http
backend eta
use-server %[lua.get_server_for_nexus] if { path_beg -i /api/nexus/new /nexus/table /socket.io/nexus }
# Server declarations
And I’m getting the following error when I start HAProxy: config : backend 'eta' : unable to find server '%[lua.get_server_for_nexus]' referenced in a 'use-server' rule.
Does anyone know if the post above is still valid for version 1.8.3?