Dear all,
I use haproxy 1.6.7 on a FreeBSD host.
I just try to do the following:
Check if hostname is domain1 or domain2 or bladomain3 or ... , mark it
to send the request to nginx
all other requests should go to apache backend.
Check if client support http2, if yes and nginx acl matches, send it to
nginx with a special port.
All the rest should go to apache backend.
I tried to do this using two acls and 3 backends (apache, nginx,
nginx-http2).
But I could not get it working and I'm not sure what I'm doing wrong.
Here my frontend and backend definition:
frontend www-https
mode tcp
bind 192.168.0.251:8443 ssl crt /usr/local/etc/haproxy/certs/
alpn h2,http/1.1
bind 192.168.200.6:8443 ssl crt /usr/local/etc/haproxy/certs/
alpn h2,http/1.1
bind localhost:443 ssl crt /usr/local/etc/haproxy/certs/ alpn
h2,http/1.1
bind 127.0.0.1:443 ssl crt /usr/local/etc/haproxy/certs/ alpn
h2,http/1.1
acl use_nginx hdr(host) -i domain1 domain2 bladomain3
acl http2 ssl_fc_alpn -i h2
use_backend nginx-http2-backend if use_nginx http2
use_backend nginx-http-backend if use_nginx
default_backend apache-backend
backend apache-backend
server www-1 127.0.0.1:8081 check
backend nginx-http-backend
server www-1 127.0.0.1:8082 check
backend nginx-http2-backend
mode tcp
http-request add-header X-Forwarded-Proto https
server www-1 127.0.0.1:8083 check send-proxy
Can please someone point me to the mistake I did?
Thanks a lot!
Gruß
Matthias
--
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning." --
Rich Cook