I am trying to solve an issue with an internal ProxyPass setup on an apache http server, version 2.4. Everything works fine otherwise, it is just this ProxyPass issue that I fail to solve:
I operate several name based virtual hosts on a single system with example.org
serving as the default host and all hosts using the https
protocol on port 443 with valid (signed) certificates:
- example.org
- host1.example.org
- host2.example.org
For one single type of request I want to setup an internal ProxyPass rule to example.org
.
https://host1.example.org/_-_-_/bar => https://example.org/foo/bar
A ProxyPassReverse is not required, since no result is returned. (I also tried with, but that does not make any difference):
This is the rule set which is part of the configuration of host host1.example.org
:
SSLProxyEngine On
ProxyRequests Off
ProxyVia Off
ProxyPass "/_-_-_/bar" "https://example.org/foo/bar"
The proxy does work, it proxies the request. But the issue is that it does not request the correct host! So not example.org
but the originally requested host host1.example.org
, so it requests itself. I can clearly see both requests in the same access log file whilst the access log of example.org
stays untouched. Obviously that behavior results in a http status 404. That is also shown on the client side as an error message generated by host host1.example.org
(fine) but showing the internal path /foo/bar
(not fine)!So my question obviously is:
What to change so that the proxy request is internally processed by the desired virtual host?