Forward http ssl to NGINX

Hello,

I’m fairly new to using Haproxy. Right now I run a couple VM’s that contain fully automated domains. Registering of the domain, creating the NGINX config and assigning the Let’s Encrypt certificate. The renewal is also automated. Now I want to take a incoming request in haproxy, see if it is http or https and forward it to the nginx vm. This is my current config:

frontend private-www
        bind *:80
        bind *:443

        mode tcp

        acl host_supported hdr(host) -i domain-a.nl
        acl host_supported hdr(host) -i domain-b.com domain-b.nl
        acl host_supported hdr(host) -i nginx.example.com

        acl is_http dst_port 80
        acl is_https dst_port 443

        use_backend private-www_http if host_supported is_http
        use_backend private-www_https if host_supported is_https

backend private-www_http
        mode http
        server www_10_1_0_52 10.1.0.52:80 check

backend private-www_https
        mode http
        server www_10_1_0_52 10.1.0.52:443 check

But I did swap around with some modes etc. Could not get it to work. HTTP worked fine. Could anyone help me out?

Fixed it by using TCP Inspect!