0
我有这个问题,我的apache转发http请求到tomcat使用代理(请参阅我的apache虚拟主机配置下面)。它工作正常,但网络http请求http://subdomain.example.com/xyz/images/background2.jpg抵达tomcat as /xyz/xyz/images/background2.jpg。上下文名称“xyz”会出现两次,这会导致tomcat结尾处缺少资源。如何防止apache代理设置中的tomcat7重复上下文名称
你如何解决这个问题?
Apache虚拟主机配置文件
<VirtualHost *:80>
ServerName subdomain.example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass/http://www.example.com:8080/xyz/
ProxyPassReverse/http://www.example.com:8080/xyz/
</VirtualHost>
Tomcat项目设置:../ tomcat7/webapps /目录XYZ/...
我的项目放在Tomcat中作为../ tomcat7/webapps/xyz/....我的意图是将subdomain.example.com url映射到tomcat project url http://www.example.com :8080/xyz /,因此上面的设置。我不想将我的项目重命名为ROOT,因为我知道它不是由tomcat推荐的。 – Shawn 2014-09-03 15:00:33