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. LVM的一般操作过程

    1. 在磁盘分区上建立物理卷  #fdisk /dev/hdb  #pvdisplay /dev/hdb1 //在已经建立好的分区或硬盘上建立物理卷  #pvcreate /dev/hdb1    2 ...

  2. MSSQL奇技淫巧

    MSSQL:获得库每个表的记录数和容量 sp_msforeachtable是MS未公开的存储过程: exec sp_msforeachtable @command1="print '?'&q ...

  3. libevent: linux安装libevent

    http://libevent.org/上下载最新的libevent, 如 libevent-2.0.22-stable.tar.gz. 然后解压,按照README里面的步骤安装.

  4. net use \\192.168.54.145 /user:administrator "12345qwert"无法连接,错误码1326

    1.在远程机的"控制面板-文件夹选项-查看-简单的文件共享",去掉选取,然后再尝试连接 2.控制面板\所有控制面板项\管理工具 下-->本地安全策略-->安全设置--& ...

  5. Hibernate 多对多映射

    package com.entity.manytomany; import java.util.List; import javax.persistence.Entity; import javax. ...

  6. 修改linux文件权限命令:chmod 【转载】

    Linux系统中的每个文件和目录都有访问许可权限,用它来确定谁可以通过何种方式对文件和目录进行访问和操作. chmod  命令可以改变所有子目录的权限,下面有2种方法 改变一个文件的权限: chmod ...

  7. iOS开发之iOS7设置状态栏字体颜色

    应用中登陆界面颜色较浅,状态栏字体颜色为黑色,跳转到主界面之后,界面颜色较深,状态栏颜色随之变成白色.但是再重新返回登陆界面后,状态栏字体颜色并没有改成黑色,特别别扭. plist文件里将View c ...

  8. mac忘记登陆密码解决

    重新启动苹果电脑,开机时按住“command”键+“S”键,(普通键盘按住win+s)会进入单用户模式, 出现像DOS一样的提示符 #root>依次输入如下三个命令:(注意空格 注意大小写) f ...

  9. Visual Studio 2012的新技术特性

    前言 我更换了VS2012开发工具,那么它有什么特性呢? [caption id="attachment_1235" align="alignnone" wid ...

  10. HDU 4720Naive and Silly Muggles热身赛2 1005题(分锐角钝角三角形讨论)

    Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/ ...