Hi Holger.

Am 20-05-2016 15:49, schrieb Holger Just:
Hi Aleks,

Aleksandar Lazic wrote:
### bind :${ROUTER_SERVICE_HTTP_PORT}
${ROUTER_SERVICE_HTTP_PORT_BIND_OPTONS} ###

It's look to me that this is not possible.

To quote from Section 2.3 of configuration.txt:

Those variables are interpreted only within double quotes. Variables
are expanded during the configuration parsing. Variable names must be
preceded by a dollar ("$") and optionally enclosed with braces ("{}")
similarly to what is done in Bourne shell.

Thus, it should work once you enclose your bind values into double
quotes (without the potential linebreak added by my mail client):

bind ":${ROUTER_SERVICE_HTTP_PORT}"
"${ROUTER_SERVICE_HTTP_PORT_BIND_OPTONS}"

This will however prevent you from setting multiple (space-separated)
bind options as they will only be recognized as a single value due to
the quotes.

Thanks for answer.

Here the tests which I have done.

#####
bind ":${ROUTER_SERVICE_HTTP_PORT}" "${ROUTER_SERVICE_HTTP_PORT_BIND_OPTONS}"

+ /usr/sbin/haproxy -f /var/lib/haproxy/conf/haproxy.config -p /var/lib/haproxy/run/haproxy.pid [ALERT] 140/141739 (19) : parsing [/var/lib/haproxy/conf/haproxy.config:55] : 'bind' : invalid address: '"' in '":${ROUTER_SERVICE_HTTP_PORT}"' [ALERT] 140/141739 (19) : Error(s) found in configuration file : /var/lib/haproxy/conf/haproxy.config
[ALERT] 140/141739 (19) : Fatal errors found in configuration.
#####

#####
bind :"${ROUTER_SERVICE_HTTP_PORT}" "${ROUTER_SERVICE_HTTP_PORT_BIND_OPTONS}"

+ /usr/sbin/haproxy -f /var/lib/haproxy/conf/haproxy.config -p /var/lib/haproxy/run/haproxy.pid [ALERT] 140/142049 (18) : parsing [/var/lib/haproxy/conf/haproxy.config:55] : 'bind' : invalid character '"' in port number '"9080"' in ':"${ROUTER_SERVICE_HTTP_PORT}"' [ALERT] 140/142049 (18) : Error(s) found in configuration file : /var/lib/haproxy/conf/haproxy.config
[ALERT] 140/142049 (18) : Fatal errors found in configuration.
#####

#####
bind :${ROUTER_SERVICE_HTTP_PORT} "${ROUTER_SERVICE_HTTP_PORT_BIND_OPTONS}"

+ /usr/sbin/haproxy -f /var/lib/haproxy/conf/haproxy.config -p /var/lib/haproxy/run/haproxy.pid [ALERT] 140/142259 (19) : parsing [/var/lib/haproxy/conf/haproxy.config:55] : 'bind :${ROUTER_SERVICE_HTTP_PORT}' unknown keyword '"${ROUTER_SERVICE_HTTP_PORT_BIND_OPTONS}"'. Registered keywords :
    [ ALL] accept-proxy
    [ ALL] backlog <arg>
    [ ALL] id <arg>
    [ ALL] maxconn <arg>
    [ ALL] name <arg>
    [ ALL] nice <arg>
    [ ALL] process <arg>
    [UNIX] gid <arg>
    [UNIX] group <arg>
    [UNIX] mode <arg>
    [UNIX] uid <arg>
    [UNIX] user <arg>
    [STAT] level <arg>
    [ TCP] defer-accept
    [ TCP] interface <arg>
    [ TCP] mss <arg>
    [ TCP] tcp-ut <arg>
    [ TCP] tfo
    [ TCP] transparent
    [ TCP] v4v6
    [ TCP] v6only
    [ SSL] alpn <arg>
    [ SSL] ca-file <arg>
    [ SSL] ca-ignore-err <arg>
    [ SSL] ciphers <arg>
    [ SSL] crl-file <arg>
    [ SSL] crt <arg>
    [ SSL] crt-ignore-err <arg>
    [ SSL] crt-list <arg>
    [ SSL] ecdhe <arg>
    [ SSL] force-sslv3
    [ SSL] force-tlsv10
    [ SSL] force-tlsv11
    [ SSL] force-tlsv12
    [ SSL] no-sslv3
    [ SSL] no-tlsv10
    [ SSL] no-tlsv11
    [ SSL] no-tlsv12
    [ SSL] no-tls-tickets
    [ SSL] ssl
    [ SSL] strict-sni
    [ SSL] verify <arg>
    [ SSL] npn <arg>
[ALERT] 140/142259 (19) : Error(s) found in configuration file : /var/lib/haproxy/conf/haproxy.config
[ALERT] 140/142259 (19) : Fatal errors found in configuration.
#####

My conclusion is that with or without " the ${...} is not substituted, at least in the bind line.

Best regards
aleks

Reply via email to