C:\>ping wechatTest.winfae.com

正在 Ping wechatTest.winfae.com [120.55.118.6] 具有 32 字节的数据:
来自 120.55.118.6 的回复: 字节=32 时间=5ms TTL=54
来自 120.55.118.6 的回复: 字节=32 时间=4ms TTL=54 指向120.55.118.6的haproxy机器 120.55.118.6haproxy 默认全部转发到8088 ###匹配wechatTest.winfae.com 开头的 ####判断用户访问如果主机名以www开头的话则标示为host_www
####acl host_www hdr_beg(host) -i www acl hmq_6_req hdr_beg(host) -i wechatTest.winfae.com use_backend wechatTest.winfae.com if hmq_6_req backend wechatTest.winfae.com
mode http
balance roundrobin
server hmq_host_80 115.236.160.83:8088 check inter 2000 fall 3 weight 20 115.236.160.83 映射到内网的192.168.32.82
default_backend webserver_8088 192.168.32.82 在跳转到192.168.32.16 backend webserver_8088
mode http
balance roundrobin
server webhost01_8001 192.168.32.16:80 check inter 2000 fall 3 192.168.32.16上的配置:
acl wxtest_6_req hdr_beg(host) -i wechatTest.winfae.com
acl url_static_zjdev path_end .html .gif .png .jpg .css .js
use_backend www.guozhenshi.com if wxtest_6_req url_static_zjdev acl wxtest_1_req hdr_beg(host) -i wechatTest.winfae.com
acl url_web_wxtest path_beg -i /web
use_backend appserver_8081 if wxtest_1_req url_web_wxtest acl wxtest_2_req hdr_beg(host) -i wechatTest.winfae.com
acl url_business_wxtest path_beg -i /business
use_backend appserver_8081 if wxtest_2_req url_business_wxtest acl wxtest_3_req hdr_beg(host) -i wechatTest.winfae.com
acl url_validcode_wxtest path_beg -i /validcode
use_backend appserver_8081 if wxtest_3_req url_validcode_wxtest acl wxtest_4_req hdr_beg(host) -i wechatTest.winfae.com
acl url_api_wxtest path_beg -i /api
use_backend appserver_8082 if wxtest_4_req url_api_wxtest acl wxtest_5_req hdr_beg(host) -i wechatTest.winfae.com
acl url_pay_wxtest path_beg -i /pay
use_backend appserver_8083 if wxtest_5_req url_pay_wxtest 测试: jrhdpt11:/root/sbin# curl https://wechattest.winfae.com/web/noauth?method=%2Fproduct%2Ftype%2Fall%2Fzhongjun&_=1467186118610
[1] 27887
You have new mail in /var/spool/mail/root
jrhdpt11:/root/sbin# {"data":[{"code":1,"value":"至信系列"},{"code":2,"value":"活动专享"},{"code":3,"value":"鎏金系列"}],"retCode":"0000","retMsg":"查询成功"} 发现2个问题: 1.http://wechattest.winfae.com/index.html 不跳https 在wx03 上没有配置 redirect scheme https if !{ ssl_fc } 2.https://wechattest.winfae.com/ 访问返回503 Service Unavailable Jun 29 15:59:36 localhost haproxy[1153]: 192.168.32.82:39666 [29/Jun/2016:15:59:36.972] http http/<NOSRV> -1/-1/-1/-1/0 503 212 - - SC-- 2/2/0/0/0 0/0 "GET / HTTP/1.1"
Jun 29 15:59:43 localhost haproxy[1153]: 192.168.32.82:39687 [29/Jun/2016:15:59:43.466] http http/<NOSRV> -1/-1/-1/-1/0 503 212 - - SC-- 2/2/0/0/0 0/0 "GET / HTTP/1.1"
Jun 29 15:59:45 localhost haproxy[1153]: 192.168.32.82:39692 [29/Jun/2016:15:59:45.115] http http/<NOSRV> -1/-1/-1/-1/0 503 212 - - SC-- 2/2/0/0/0 0/0 "GET / HTTP/1.1"
Jun 29 15:59:46 localhost haproxy[1153]: 192.168.32.82:39698 [29/Jun/2016:15:59:46.665] http http/<NOSRV> -1/-1/-1/-1/0 503 212 - - SC-- 2/2/0/0/0 0/0 "GET / HTTP/1.1"
Jun 29 15:59:52 localhost haproxy[1153]: 192.168.32.82:39715 [29/Jun/2016:15:59:52.019] http www.guozhenshi.com/gzs_host_80 0/0/0/1/1 304 238 - - ---- 0/0/0/0/0 0/0 "GET /index.html HTTP/1.1"
Jun 29 15:59:52 localhost haproxy[1153]: 192.168.32.82:39716 [29/Jun/2016:15:59:52.079] http www.guozhenshi.com/gzs_host_80 0/0/0/2/2 304 238 - - ---- 0/0/0/0/0 0/0 "GET /resources/css/base.css?_v=${last.updated} HTTP/1.1"
Jun 29 15:59:52 localhost haproxy[1153]: 192.168.32.82:39717 [29/Jun/2016:15:59:52.097] http www.guozhenshi.com/gzs_host_80 0/0/0/2/2 304 238 - - ---- 3/3/3/3/0 0/0 "GET /resources/css/index.css?_v=${last.updated} HTTP/1.1"
Jun 29 15:59:52 localhost haproxy[1153]: 192.168.32.82:39718 [29/Jun/2016:15:59:52.098] http www.guozhenshi.com/gzs_host_80 0/0/0/1/2 304 238 - - ---- 2/2/2/2/0 0/0 "GET /resources/plugins/mCustomScrollbar/jquery.mCustomScro 查看haproxy 配置: acl host_winfae.com hdr_beg(host) -i wechatTest.winfae.com
redirect prefix https://wechatTest.winfae.com/index.html if host_winfae.com 会跳成https://wechattest.winfae.com/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/ acl wiki hdr_reg(host) -i wechatTest.winfae.com
redirect location https://wechatTest.winfae.com/index.html code 301 if wiki hdr_beg(host) 匹配主机名开头 acl bbs hdr_reg(host) -i ^(bbs.test.com|forum.test.com) #使用正则匹配 acl wiki hdr_reg(host) -i wechatTest.winfae.com
redirect location https://wechatTest.winfae.com/index.html code 301 if wiki

多个haproxy 之间跳转的更多相关文章

  1. Haproxy 重定向跳转设置 - 运维小结

    前面已经详细介绍了Haproxy基础知识 , 今天这里再赘述下Haproxy的重定向跳转的设置.  haproxy利用acl来实现haproxy动静分离,然而在许多运维应用环境中,可能需要将访问的站点 ...

  2. iOS应用之间跳转

    本篇博文将涉及到以下知识点: app应用跳转的原理解析 如何实现两个app应用之间的跳转 如何实现两个app之间跳转到指定界面 二.应用跳转原理 相信从一个应用跳转到另一个应用大家并不陌生,最常见的莫 ...

  3. ios两个app之间跳转,传值的实现

    两个APP之间的跳转是通过[[UIApplication sharedApplication] openURL:url]这种方式来实现的. 1.首先设置第一个APP的url地址 2.接着设置第二个AP ...

  4. mooc-IDEA 项目/文件之间跳转--002

    二.IntelliJ IDEA -项目之间跳转 1.Next Project Window :跳转到下一个项目 [ ctrl+alt+) ] 2.Previous Project Window:跳转到 ...

  5. iOS App之间跳转

    1.先来看看效果,这里做了三个功能 从MyApp跳转到YourApp 从MyApp跳转到YourApp的指定页面 从YourApp使用跳转url的方式跳回MyApp 2.实现app之间的跳转需要注意两 ...

  6. Android之Activity之间跳转

    本人自学Android,想到什么就写点什么.主要是怕忘了,哈哈~请观者不要建议~ 今天写点Android窗口之间的跳转以及自己理解: 1.Android中窗口之间的跳转,就是Activity之间的跳转 ...

  7. Android:Activity之间跳转和参数传递

    一个activity就好比一个网页,此文章讲解怎样创建一个activity并且实现跳转! 一.学习创建Activity 1.新建一个java类,右击src目录,选择new-->class,新的a ...

  8. PHP页面之间跳转方法总结

    编程中,在页面之间进行跳转是必须的.这里列出了三种办法,供参考. 一.用HTTP头信息 也就是用PHP的HEADER函数.PHP里的HEADER函数的作用就是向浏览器发出由HTTP协议规定的本来应该通 ...

  9. android入门:activity之间跳转,并且回传参数

    介绍:         两个activity进行跳转,在跳转过程中,将message由MainActivity传递到secondActivity,并且当secondActivity退回至MainAct ...

随机推荐

  1. C语言宏定义技巧

    出处:http://blog.chinaunix.net/uid-14022540-id-2849095.html 1.宏中"#"和"##"的用法 一.一般用法 ...

  2. BZOJ 3039: 玉蟾宫( 悬线法 )

    最大子矩阵...悬线法..时间复杂度O(nm) 悬线法就是记录一个H向上延伸的最大长度(悬线), L, R向左向右延伸的最大长度, 然后通过递推来得到. ----------------------- ...

  3. BZOJ 4057: [Cerc2012]Kingdoms( 状压dp )

    状压dp.... 我已开始用递归结果就 TLE 了... 不科学啊...我dp基本上都是用递归的..我只好改成递推 , 刷表法 将全部公司用二进制表示 , 压成一个数 . 0 表示破产 , 1 表示没 ...

  4. JVM调优总结(一)-- 一些概念

    数据类型 Java虚拟机中,数据类型可以分为两类:基本类型和引用类型.基本类型的变量保存原始值,即:他代表的值就是数值本身:而引用类型的变量保存引用值.“引用值”代表了某个对象的引用,而不是对象本身, ...

  5. Silk Icons —— 再来 700 个免费小图标

    http://mp.weixin.qq.com/mp/appmsg/show?__biz=MjM5NzM0MjcyMQ==&appmsgid=10000977&itemidx=2&am ...

  6. mysql 如何修改、添加、删除表主键

    在我们使用mysql的时候,有时会遇到须要更改或者删除mysql的主键,我们能够简单的使用alter table table_name drop primary key;来完成.以下我使用数据表tab ...

  7. SSH框架之Hibernate(1)——映射关系

    ORM的实现思想就是将关系数据库中表的数据映射成对象.以对象的形式展现,这样开发者就能够把对数据库的操作转化为对这些对象的操作.Hibernate正是实现了这样的思想,达到了方便开发者以面向对象的思想 ...

  8. API通用设计原则

    什么是好的API? ·        完备(Be Complete) 对确定重点支持的用户场景具有完备的功能支持.就是说,用户通过对一组API的调用能够完成预期的功能. ·        不冗余(Be ...

  9. IE保护模式下ActiveX控件打不开共享内存的解决方案

    原文:http://www.cppblog.com/Streamlet/archive/2012/10/25/193831.html 感谢溪流漫话的投递 IE保护模式下,ActiveX控件会打不开别的 ...

  10. Java--Eclipse关联Java源码

    打开Eclipse,Window->Preferences->Java 点Edit按钮后弹出: 点Source Attachment后弹出: 选择Java安装路径下的src.zip文件即可 ...