I need to redirect all apache requests to 80 to tomcat to 8080, except for one path.
So, if you get http://example.com/anything -> tomcat: 8080.
But, if the url is this: http://example.com/site → apache should serve and no redirect is required.
There is currently a folder called site inside /var/www/html/ .
This is my current configuration file:
site.conf (this file contains only the following and is located inside the conf.d folder)
<LocationMatch "/*"> Allow from all ProxyPass /site ! ProxyPass http://127.0.0.1:8080 ProxyPassReverse http://127.0.0.1:8080 </LocationMatch>
I think this is a simple case with apache, but I tried everything I could find and I still get the error:
ProxyPass|ProxyPassMatch can not have a path when defined in a location.
The thing is, the root site runs on tomcat, and the other runs on apache (the one I called the site in this question).
If anyone can help, I appreciate.
Thanks!
Update 1 - 06/09/2017
I earned it if I remove LocationMatch and put ProxyPass directly in the .conf file:
ProxyPass /site ! ProxyPassReverse /site ! ProxyPass / http://127.0.0.1:8080 ProxyPassReverse / http://127.0.0.1:8080
But I would like to know why this is so? What is the effect of placing these directives outside the LocationMatch tag? And, most importantly, why can't I accomplish the same result using LocationMatch ?