免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2172 | 回复: 3
打印 上一主题 下一主题

[Web] haproxy + nginx 时遇到的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-06-07 20:10 |只看该作者 |倒序浏览
haproxy在 前 nginx在后 最后是tomcat
haproxy 配置
listen lbserver *:80
  cookie JSESSIONID prefix

  option httpchk GET /index
  server nginx1 127.0.0.1:8001 weight 1 minconn 3 maxconn 6 check inter 20000


nginx配置
http {
  include mime.types;
  default_type application/octet-stream;
  sendfile on;

  keepalive_timeout 65;

  upstream tomcat{
  server 127.0.0.1:8080 weight=1;

  }

  server {
  listen 8001;
  server_name www.xxx.cn;


  location ~ ^/static.+\.(js|gif|jpg|jpeg|css|png|bmp|swf){
  root /websites/xxx;
  }

  location ~ .*\.(js|gif|jpg|jpeg|css|png|bmp|swf) {
  root /websites/xxxxx;
  }



  location / {
  proxy_pass http://tomcat;
  }


}

这样配置下来
当访问静态内容的时候正常
但一旦访问动态内容的时候 就会在url上显示8001端口
比如访问 www.xxx.cn/index.html正常
访问jsp 就会出现 www.xxx.cn:8001/index.jsp
不知道要怎么配置才能解决这个问题

论坛徽章:
0
2 [报告]
发表于 2010-06-08 17:41 |只看该作者
有人知道不

论坛徽章:
0
3 [报告]
发表于 2010-06-10 11:56 |只看该作者
有人知道不

论坛徽章:
0
4 [报告]
发表于 2010-06-11 18:41 |只看该作者
有人知道不
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP