I am intrigued by your problem
In our case, we use a different approach (and another reverse proxy nginx or haproxy) :
1 - our reverse proxy and keycloak listen to the same path /test/auth and the
RP does not rewrite the path
=> is it possible in your apache conf to use something like : (I am not used to apache)
<Location /keycloak/ >
ProxyPass https://keycloak
:8443/keycloak/
ProxyPassReverse https://keycloak:8443/keycloak/
</Location>
2 - in KC, we use another configuration instead of hostname-path :
http-relative-path=/test/auth
(it is a build conf so, do not use --optimized in container mode with the default KC image):
Regards,
Gilles ETCHEPAREBORDE