2 instance of apache server in same ip adress

I have a domain and subdomain on same IP adress on VPS machine.

On this VPS machine, i have two apache web servers, one on port 8081, and the other on 8082

I have an instance of Haproxy on port 83

I created the ssl certificate for each one.

I want to have a config to do this :

   https://domain    --> apache web server on port 8081
   https://subdomain --> apache web server on port 8082

Thank you.

I suggest you start by reding the starter guide here:

http://docs.haproxy.org/2.8/intro.html