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. 汉高澳大利亚sinox为什么不能下载源代码,因为sinox执行unix/linux/windows规划

    中国用户下载真正的澳大利亚sinox说完后sinox没有下载源代码. 这意味着,类似linux如下载linux 开源安装. 要知道.sinox并非linux. 首先,sinox是商业操作系统,就像 w ...

  2. ADB logcat 过滤方法(抓取日志)

    1. Log信息级别 Log.v- VERBOSE  : 黑色 Log.d- DEBUG  : 蓝色 Log.i- INFO  : 绿色 Log.w- WARN  : 橙色 Log.e- ERROR ...

  3. 配置免安装版JAVA1.7的环境变量

    我用的是免安装版JAVA1.7,假设想获取JDK能够联系问我要. 1.開始配置环境变量,右击[我的电脑]---[属性]-----[高级]---[环境变量],如图: 2.选择[新建系统变量]--弹出&q ...

  4. OAuth2.0认证过程

    本文以腾讯微博为例,详细介绍OAuth2.0的认证过程. 在使用腾讯微博平台提供的API前,您需要做以下两步工作: 成为开发者,并申请appkey和appsecret 授权获取accesstoken ...

  5. Java运行时内存

    对于java程序员来说,并不必显示地对内存进行管理,一切都交给java虚拟机去做吧,而且,你也不一定做得比java虚拟机来得专业.好像所有内存管理都交给虚拟机去做就万事大吉了,但是,事实有时并非如此, ...

  6. Qt同步线程(比较清楚,而且QMutex QMutexLocker QReadWriteLock QSemaphore QWaitCondition 每个都有例子)

    Qt同步线程 我们知道,多线程有的时候是很有用的,但是在访问一些公共的资源或者数据时,需要进行同步,否则会使数据遭到破坏或者获取的值不正确.Qt提供了一些类来实现线程的同步,如QMutex,QMute ...

  7. PowerMock mock私有方法

    import java.util.Random; public class CodeWithPrivateMethod { public void meaningfulPublicApi() { if ...

  8. Java 螺纹第三版 第三章数据同步 读书笔记

    多线程间共享数据问题 一.Synchronizedkeyword      atomic一词与"原子"无关,它以前被觉得是物质的最小的单元,不能再被拆解成更小的部分.      当 ...

  9. Swift语言Storyboard教程:第一部分

    更新记录: 该Storyboard教程由Caroline Begbie更新iOS 8和Swift相关内容.原文作者为教程编纂组的成员Matthijs Hollemans. 2014/12/10更新:  ...

  10. JavaScript实现获取table中某一列的值

    JavaScript实现获取table中某一列的值 1.实现源代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional/ ...