Difficulty using haproxy with apache2 virtualhost

I’m trying to redirect user to different server based on domain hostname. It seems so easy, but I have spent a week and haven’t found a solution. This is my /etc/haproxy/haproxy.cfg.

frontend t-proxy
    mode http
    acl url_ex hdr(host) -i my.domain.xyz
    use_backend ex if url_ex
backend ex
	mode http
	balance roundrobin
	server vps12 (IP_ADDRESS_A):80 check
	server vps3 (IP_ADDRESS_B):80 backup

This is virtualhost on vps12 and vps3 (both have same copies).

<VirtualHost *:443>
    ServerAdmin user@mail.net
    ServerName my.domain.xyz
    DocumentRoot /var/www/domain

    <Directory />
         Options FollowSymLinks
         AllowOverride None

    SSLEngine on
	SSLCertificateFile /opt/acme-cert/my.domain.xyz/cert.pem
	SSLCertificateKeyFile /opt/acme-cert/my.domain.xyz/site.key
	SSLCertificateChainFile /opt/acme-cert/my.domain.xyz/fullchain.cer
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

<VirtualHost *:80>
    ServerName my.domain.xyz
    Redirect permanent / https://my.domain.xyz/

But when I type my.domain.xyz on browser, it took so long to load and I’m presented with this.

Checking haproxy.log yield this, I’m not sure if its useful.

Jun 11 08:30:44 vps-proxy haproxy[7511]: (CLIENT_IP):34498 [11/Jun/2022:08:30:44.594] t-proxy ex/vps12 0/0/1/1/2 301 423 - - ---- 1/1/0/0/0 0/0 "GET / HTTP/1.1"

Anyone can help troubleshooting this problem ? I feel like I’m missing the obvious here.

one guess:

you are connection to haproxy with port :80 (http). then there will be a forward to vp12. apache force a redirect to https://my.domain.xyz. what ip address i do get for my.domain.xyz? ip address of haproxy? if this i your complete haproxy.cfg that you haven’t configured https part. you can also do a http->https redirect straight in haproxy, see