I setup a proxy to a tomcat server and I have problem with the ProxyPassMatch directive. If I write : ProxyPassMatch ^(/.*\.page)$ ajp://hostname:8009$1 then I get the following error : Syntax error on line 573 of C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf: ProxyPass Unable to parse URL I noticed that it is the concatenation of hostname + port + $1 that causes trouble. If I remove :8009 or $1, the directive can be parsed, but of course it is not what I want ! I found the following workaroud : ProxyPassMatch ^/(.*\.page)$ ajp://hostname:8009/$1 That makes it work. Do you confirm that the initial syntax should work ?
Looking at the code, the proxy does try to parse the second parameter as a URL before ever substituting anything into it, so your workaround makes sense. I don't know the proxy well enough to say if it's necessary for it to work that way, though.
I just noticed this error occurs regardless whether one is using ajp or not. The docs for ProxyPassMatch give this reference: ^(/.*\.gif)$ http://backend.example.com$1 But if backend.example.com is on a non-default port - you get the error "ProxyPass Unable to parse URL" - for example: ERROR ProxyPassMatch (/foo.+) http://backend.example.com:2829$1 But if you add a / after the port and before the regex substitution, then all is OK (as long as the regex is fixed so as no to provide an extra prefixed / ) OK ProxyPassMatch /(foo.+) http://backend.example.com:2829/$1
Thanks for the report and analysis. Fixing this would be disproportionately disruptive, so instead I'm documenting it and pointing to this bug report for explanation and workaround ideas. Marking WONTFIX.