ProxyPass and DocumentRoot on one domain

三世轮回 提交于 2019-12-03 10:05:10

Actually, I resolved this problem with the following code:

ProxyPass /forum !
ProxyPass / http://localhost:8080/tomcat-webapp/
ProxyPassReverse / http://localhost:8080/tomcat-webapp/
Alias /forum /var/www/forum

What it is recommending is using mod_rewrite to perform the ProxyPass instead of ProxyPass/ProxyPassReverse command.

Try something like:

RewriteRule  ^/forum   -  [L]
RewriteRule  ^/(.*)    http://localhost:8080/tomcat-webapp/$1  [P,L]
ProxyPassReverse /     http://localhost:8080/tomcat-webapp/

I use:

<VirtualHost *:80>
#other irrelevant configs here
ProxyPass /forum http://localhost:8080/myBB
ProxyPassReverse /forum http://localhost:8080/myBB
ProxyPass / http://localhost:8081/tomcat-app
ProxyPassReverse / http://localhost:8081/tomcat-app
</VirtualHost>

You don't have to say "tomcat-app" if your tomcat app is the root app.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!