Hello,
I am using haproxy-1.6 with Lua. I have a use-case where I want to set the 
destination (backend server) very dynamically, based on certain layer 7 
information (I am trying to avoid updating haproxy configuration and make it 
complicated with a ~100 domain names and their corresponding backend server 
name and do a map lookup,  I want lua to do it  ) 
eg:  from lua, based on certain layer 7 information I want to change the 
backend server (set destination) it should connect to..  
 if Host is ‘example.test.com’; then backend is test1.server.com  elsif Host is 
‘example2.test.com; then backend is test2.server.com    I want to keep the 
haproxy config simple and have only the Listen directive listed and take more 
control of the request flow from the LUA code.
The ATS traffic server does provide such functionality through the LUA API hook 
to override backend server dynamically from Lua end 
 if ts.client_request.header[Host] == 'example.test.com' then      
ts.client_request.set_url_host( 
test1.server.comts.client_request.set_url_port(80)elsif 
ts.client_request.header[Host] == 'example2.test.com' then      
ts.client_request.set_url_host( test2.server.com  )     
ts.client_request.set_url_port(80)end
Is it possible to do the same using Haproxy and Lua?

Thank you,
Mrunmayi

Reply via email to