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. 使用Powershell 脚本发送邮件乱码问题?

    最近在使用Powershell 编码的时候发现一个问题,只要邮件中有中文字符的邮件执行脚本以后,我们发现收到邮件都是乱码,状况如下: 对比下Powershell脚本,我们将邮件的·ENCODING 加 ...

  2. Ubuntu 12.04 安装JDK 8和Eclipse

    Ubuntu 12.04 下安装 JDK8 方法一:(缺点是安装时附加openjdk等大量程序并无法去除,长处是安装简单) $ sudo apt-get install eclipse 方法二:(长处 ...

  3. 另外一种方式装win2008r2

    装系统有很多方法,但是这种,我很少用. 注意第二个红圈处,是要启动的电话引导盘符.容易选择你的启动U盘,如果是后者,表现出的结果就是引导U盘不能引导,且安装的电脑也会显示ntdl丢失.当然,也可以解决 ...

  4. Away3D带你360°漫游全景影像

    1代码展示 package { import away3d.containers.View3D; import away3d.controllers.HoverController; import a ...

  5. Quartz中文文档使用

    Quartz中文使用说明文档,内容相当详细,有需要的码友们可以看看!! 好东西要分享!! 下面是文档的内容目录,附上下载的地址:点击打开链接,下载文档 中文版目录总汇及内容提要 第一章. 企业应用中的 ...

  6. HDU4544 湫湫系列故事――消灭兔子

    HDU 4544 Tags: 数据结构,贪心 Analysis: 将兔子的血量从大到小排序,将箭的杀伤力从大到小排序,对于每一个兔子血量, 将比他大的杀伤力大的剑压入优先队列,优先队列自己重写,让它每 ...

  7. .Net 社区虚拟大会”(dotnetConf)

    .Net 社区虚拟大会”(dotnetConf) “.Net 社区虚拟大会”(dotnetConf) 2016 今天凌晨在Channel9 上召开,在Scott Hunter的30分钟的 Keynot ...

  8. WCF技术剖析之四:基于IIS的WCF服务寄宿(Hosting)实现揭秘

    原文:WCF技术剖析之四:基于IIS的WCF服务寄宿(Hosting)实现揭秘 通过<再谈IIS与ASP.NET管道>的介绍,相信读者已经对IIS和ASP.NET的请求处理管道有了一个大致 ...

  9. 关于 iOS 基础动画

    1,首先,在iOS中,动画有2种,一种是对 UIView 做动画处理,另一种是对 CALayer做动画. 这里我们先要搞清楚 UIView 与 CALayer 之间的关系,UIView 是界面的基础元 ...

  10. android ble蓝牙开发略解

    Android 蓝牙4.0开发 1.  权限和相关属性 “android:required="true"表示apk只有在具有bluetooth_le属性的系统里运行,这个4.3之前 ...