Set a variable in haproxy configuration and use it in Lua script

Hi,
As we can give any name for the backends in haproxy configuration,I would like to know if there is any way to send a variable with a value (suppose a backend name),so that I’ll get this value in the lua script,and I would like to query for the status of servers in the lua script.Based on that I will set the health check response.

So,I would like to know how to set a variable in haproxy configuration and then use it in lua script.
Thankyou.

If you are just trying to create a local healtcheck response for downstream proxies, you should be able to achieve this with the monitor fail option.

As for LUA, you should be able to pass variables in txn context or, at the very least, using a HTTP header.