我已经将VirtualHost
example.com配置为将所有请求代理到Tomcat服务器
ProxyPass / http://localhost:8088/app
ProxyPassReverse / http://localhost:8088/app
这工作得很好了像URL example.com/page,但对于example.com和example.com/我得到这个重定向响应,这显然会导致什么。
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
...
我该如何解决?最好在Apache配置中。
我正在使用Apache 2和Tomcat 7
If the first argument ends with a trailing /, the second argument should also end with a trailing / and vice versa. Otherwise the resulting requests to the backend may miss some needed slashes and do not deliver the expected results.