Hi Holger
Am 20-05-2016 17:02, schrieb Holger Just:
Hi Aleks,
Aleksandar Lazic wrote:
My conclusion is that with or without " the ${...} is not substituted,
at least in the bind line.
From your output, it looks like you are using an older version of
HAProxy.
yep.
####
[root@4a9889bfd2ac conf]# haproxy -vv
HA-Proxy version 1.5.14 2015/07/02
Copyright 2000-2015 Willy Tarreau <[email protected]>
Build options :
TARGET = linux2628
CPU = generic
CC = gcc
CFLAGS = -O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18
OPTIONS = USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_OPENSSL=1
USE_PCRE=1
Default settings :
maxconn = 2000, bufsize = 16384, maxrewrite = 8192, maxpollevents =
200
Encrypted password support via crypt(3): yes
Built with zlib version : 1.2.7
Compression algorithms supported : identity, deflate, gzip
Built with OpenSSL version : OpenSSL 1.0.1e-fips 11 Feb 2013
Running on OpenSSL version : OpenSSL 1.0.1e-fips 11 Feb 2013
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports prefer-server-ciphers : yes
Built with PCRE version : 8.32 2012-11-30
PCRE library supports JIT : no (USE_PCRE_JIT not set)
Built with transparent proxy support using: IP_TRANSPARENT
IPV6_TRANSPARENT IP_FREEBIND
Available polling systems :
epoll : pref=300, test result OK
poll : pref=200, test result OK
select : pref=150, test result OK
Total: 3 (3 usable), will use epoll.
####
The behavior of quoted strings in the config changed in HAProxy
1.6. It appears you are using an older version (e.g. 1.5) which does
indeed not support this syntax.
That said, even on HAProxy 1.5.14, I have been able to validate your
syntax (there without the quotes).
Please ensure you are using a resonably up-to-date version of HAProxy
(which you can verify with `haproxy -vv`) and that you actually set all
used environment variables with their respective values when starting
HAProxy.
Okay I have now used more or less recent versions ;-).
curl -vO
http://www.haproxy.org/download/1.7/src/snapshot/haproxy-ss-20160520.tar.gz
curl -vO http://www.haproxy.org/download/1.6/src/haproxy-1.6.5.tar.gz
curl -vO http://www.haproxy.org/download/1.5/src/haproxy-1.5.18.tar.gz
The last one is crucial as HAProxy does not replace environment
variables in the config file if the environment variable is not
actually
defined. From your original output, it appears you are not defining the
${ROUTER_SERVICE_HTTPS_PORT_BIND_OPTONS} variable in the environment
which thus results in the parse error.
Looks like you are right.
test_env_haproxy.conf
https://gist.github.com/anonymous/4c9af7b622d072c7a58d85d5794e0fa7
20.05.2016 22:30 export PORT=8081
20.05.2016 22:30 export PORT_OPTS="accept-proxy"
OK
haproxy-1.6.5/haproxy -f test_env_haproxy.conf -d
haproxy-ss-20160520/haproxy -f test_env_haproxy.conf -d
NOK
haproxy-1.5.18/haproxy -f test_env_haproxy.conf -d
Thanks.
Best regards
Aleks