Dear community, i try to chain 2 haproxy like:
Clients-------HAproxyFrontEnd:443----------HAproxyBackEnd:443--------Webserver:443
I receive an error 502 Bad Gateway below my configuration
HAProxyFrontEnd:
global
log /dev/log local0 debug
log /dev/log local1 debug
log /dev/log local2 debug
log /dev/log local3 debug
log /dev/log local4 debug
log /dev/log local5 debug
stats socket /run/haproxy/admin.sock mode 660 level admin
maxconn 50000
chroot /var/lib/haproxy
nbproc 1
nbthread 12
cpu-map auto:1/1-4 0-3
user haproxy
group haproxy
daemon
Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
tune.ssl.default-dh-param 2048
ssl-server-verify none
# See: https://ssl-config.mozilla.org/#server=haproxy&server-version=2.0.3&config=intermediate
ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA38$
ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
defaults
log global
mode http
option dontlognull
option forwardfor
timeout client 30s
timeout connect 10s
timeout server 120s
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
#Main FrontEnd
frontend ft_https
bind :443 ssl crt /etc/haproxy/crt/
mode http
log /dev/log local0 debug
default_backend bk_1
ACL #########3
acl bk_1 ssl_fc_sni www.mydomain.ch
use_backend bk_1 if bk_1
server for www.mydomain.ch
backend bk_1
mode http
option forwardfor
log /dev/log local0 debug
timeout connect 30000
timeout server 30000
server www.mydomain.ch 192.168.99.59:443 send-proxy-v2
HAProxyBackEnd:
global
log /dev/log local0 debug
log /dev/log local1 debug
log /dev/log local2 debug
log /dev/log local3 debug
log /dev/log local4 debug
log /dev/log local5 debug
stats socket /run/haproxy/admin.sock mode 660 level admin
maxconn 50000
chroot /var/lib/haproxy
nbproc 1
nbthread 12
cpu-map auto:1/1-4 0-3
user haproxy
group haproxy
daemon
Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
tune.ssl.default-dh-param 2048
ssl-server-verify none
defaults
log global
mode http
option dontlognull
option forwardfor
timeout client 30s
timeout connect 10s
timeout server 120s
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
#Main FrontEnd
frontend ft_https
bind :443 accept-proxy ssl crt /etc/haproxy/crt/haproxy.pem
mode http
log /dev/log local0 debug
acl bk_st_docker ssl_fc_sni www.mydomain.ch
use_backend bk_st_docker if bk_st_docker
backend bk_st_docker
mode http
log global
server docker-hap 192.168.99.172:443
Idea are welcome
Regards