Thanks lukastribus for help. This is my haproxy config - or at least a the frontend part of it. If I understand you correctly the missing directive should be in here somewhere. Since I am not a haproxy expert at all, any tips on what the key directives are and how they can be changed would be greatly appreciated:
.....
frontend http
mode http
bind 0.0.0.0:80 name v4
bind :::80 name v6
http-request set-var(txn.base) base
http-request set-var(txn.path) path
http-request set-var(txn.host) req.hdr(Host),field(1,:),lower
http-request set-var(txn.host_match) var(txn.host),map(/etc/haproxy/maps/host.map)
http-request set-var(txn.host_match) var(txn.host),regsub(^[^.]*,,),map(/etc/haproxy/maps/host.map,'') if !{ var(txn.host_match) -m found }
http-request set-var(txn.path_match) var(txn.host_match),concat(,txn.path,),map(/etc/haproxy/maps/path-exact.map)
http-request set-var(txn.path_match) var(txn.host_match),concat(,txn.path,),map_beg(/etc/haproxy/maps/path-prefix.map) if !{ var(txn.path_match) -m found }
http-request replace-path (.*) / if { var(txn.path_match) -m dom 43b315f758eafb40dea2961a0801639d }
use_backend %[var(txn.path_match),field(1,.)]
default_backend default-haproxy-controller-kubernetes-ingress-default-backend-http
frontend https
mode http
bind 0.0.0.0:443 name v4 crt /etc/haproxy/certs/frontend ssl alpn h2,http/1.1
bind :::443 name v6 crt /etc/haproxy/certs/frontend ssl alpn h2,http/1.1
http-request set-var(txn.base) base
http-request set-var(txn.path) path
http-request set-var(txn.host) req.hdr(Host),field(1,:),lower
http-request set-var(txn.host_match) var(txn.host),map(/etc/haproxy/maps/host.map)
http-request set-var(txn.host_match) var(txn.host),regsub(^[^.]*,,),map(/etc/haproxy/maps/host.map,'') if !{ var(txn.host_match) -m found }
http-request set-var(txn.path_match) var(txn.host_match),concat(,txn.path,),map(/etc/haproxy/maps/path-exact.map)
http-request set-var(txn.path_match) var(txn.host_match),concat(,txn.path,),map_beg(/etc/haproxy/maps/path-prefix.map) if !{ var(txn.path_match) -m found }
http-request set-header X-Forwarded-Proto https
http-request replace-path (.*) / if { var(txn.path_match) -m dom 43b315f758eafb40dea2961a0801639d }
use_backend %[var(txn.path_match),field(1,.)]
default_backend default-haproxy-controller-kubernetes-ingress-default-backend-http