首页 技术 正文
技术 2022年11月16日
0 收藏 949 点赞 3,819 浏览 4119 个字
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_8088192.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 3192.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 UnavailableJun 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 wikihdr_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
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,078
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,553
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,402
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,177
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,814
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898