Help me with ACL for TCP

I want to use HAProxy to redirect services based on domain name.

i.e.
host1.example.com --> service1
host2.example.com --> service2

How should I proceed?

It’s been my n00b experience that there are some questions that you must first answer before proceeding.

Mainly these questions have to do with certificates. (I hope I don’t confuse more)

What service will handle the certs? In my case, I used certbot to generate certs for example1.com and example2.com. In my case, I did not want haproxy to do anything with certs.

See: https://www.haproxy.com/documentation/haproxy/deployment-guides/tls-infrastructure/

if you want haproxy to handle certs; See: https://www.haproxy.com/blog/haproxy-ssl-termination/

That is, unfortunately, the limits of my knowledge.