我已将VirtualHost example.comconfiguration为将所有请求都委托给Tomcat服务器
ProxyPass / http://localhost:8088/app ProxyPassReverse / http://localhost:8088/app
这适用于像example.com/page这样的URL,但是对于example.com和example.com/,我得到这个redirect响应,这显然导致什么都没有。
HTTP/1.1 302 Moved Temporarily Date: Wed, 06 Jul 2011 21:13:37 GMT Server: Apache-Coyote/1.1 <-- the redirect comes from tomcat Location: http://example.com/app/ <-- nonsense ...
我能做些什么来解决它? 最好在Apacheconfiguration中。
我正在使用Apache 2和Tomcat 7
我不确定为什么,但这是修复
ProxyPass / http://localhost:8088/app/ ProxyPassReverse / http://localhost:8088/app/
(最后加斜杠)