开发者社区> 问答> 正文

Apache代理tomcat总不时出现循环重定向,如何解决?

Apache代理tomcat能够跑起来,但是浏览器访问的时候,不时出现循环重定向的提示, 刷新几下又好了,日志方面也看不出什么原因,还望大神指教
我贴一下我的配置 服务器是win2003 64位, Apache 2.2, tomcat 7
Apache
1, 通过http模式, 加载这两个模块

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

2,配置了下线程数

KeepAlive on
KeepAliveTimeout 15 
<IfModule mpm_winnt.c>
ThreadsPerChild 500     
MaxRequestsPerChild  5000     
#Win32DisableAcceptEx
</IfModule> 

3, 配置vhost Include conf/extra/httpd-vhosts.conf
vhost.conf 配置

    <VirtualHost *:80>
    #ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "c:/Apache2/docs/"
    ServerName test.abc.com
    ServerAlias test.abc.com
    ErrorLog "logs/test.abc.com-error.log"
    CustomLog "logs/test.abc.com-access.log" common
    ProxyPreserveHost On
    ProxyPass /arrow-test/rescources !
    ProxyPass  /arrow-test http://127.0.0.1:8080/arrow-test
    ProxyPassReverse  /arrow-test http://127.0.0.1:8080/arrow-test
    ProxyPass /resources !
    ProxyPass  / http://127.0.0.1:8080/
    ProxyPassReverse  / http://127.0.0.1:8080/
</VirtualHost>

tomcat 下面两个项目一个arrow-test是后台,一个arrow-test-front
配置的路径分别是 /arrow-test 和 / , resource是资源文件夹

展开
收起
落地花开啦 2016-05-31 16:21:07 3070 0
1 条回答
写回答
取消 提交回答
  • 喜欢技术,喜欢努力的人

    ProxyPassReverse /examw-test http://127.0.0.1:8080/arrow-test
    这两个路径不一致啊
    其实你的配置只需要
    `ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/`
    就足够了

    2019-07-17 19:22:09
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Apache Flink技术进阶 立即下载
Apache Spark: Cloud and On-Prem 立即下载
Hybrid Cloud and Apache Spark 立即下载

相关镜像