如何在haproxy中使用环境variables?

我使用haproxy 1.5.2我的haproxy.cfg有这个服务器定义:

server HALB_ucd1 ${UCD1_END_POINT_IP}:${UCD1_END_POINT_PORT} check port 8444 

我在bash中设置了UCD1_END_POINT_IP和UCD1_END_POINT_PORT,并使用haproxy重启服务启动haproxy

haproxy重新启动,但UCD1_END_POINT_IP和UCD1_END_POINT_PORT未parsing。 我看到,按照haproxy文档它是支持的:

  Any part of the address string may reference any number of environment variables by preceding their name with a dollar sign ('$') and optionally enclosing them with braces ('{}'), similarly to what is done in Bourne shell. 

如果我改变它硬编码的IP和端口它工作正常。 我错过了什么?

谢谢!

你可能会尝试使用类似的东西:

 server HALB_ucd1 "${UCD1_END_POINT_IP}:${UCD1_END_POINT_PORT}" check port 8444 

尝试使用: env(variablename)

但是,这个选项似乎只存在于1.5+。

http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#7.3.2-env