hdr_beg(host) hdr_reg(host) hdr_dom(host)
case 1
测试hdr_beg(host) 的情况
acl zjtest7_com hdr_beg(host) -i zjtest7.com
use_backend zjtest7_com if zjtest7_com
acl api_zjtest7_com hdr_beg(host) -i api.zjtest7.com
use_backend api_zjtest7_com if api_zjtest7_com
backend zjtest7_com
mode http
server apphost_1 192.168.32.101:3000 check inter 2000 fall 3
backend api_zjtest7_com
mode http
server apphost_1 192.168.32.76:8001 check inter 2000 fall 3
zjtest7-haproxy:/root# curl zjtest7.com/scan/test
welcome wxpod999zjtest7-haproxy:/root#
zjtest7-haproxy:/root# curl api.zjtest7.com:8001/scan/index.html
abc20161216123dasd-9ad-0-a09
此时没问题
测试 hdr_reg(host) 的情况:
acl zjtest7_com hdr_reg(host) -i zjtest7.com
use_backend zjtest7_com if zjtest7_com
acl api_zjtest7_com hdr_reg(host) -i api.zjtest7.com
use_backend api_zjtest7_com if api_zjtest7_com
backend zjtest7_com
mode http
server apphost_1 192.168.32.101:3000 check inter 2000 fall 3
backend api_zjtest7_com
mode http
server apphost_1 192.168.32.76:8001 check inter 2000 fall 3
zjtest7-haproxy:/root# curl zjtest7.com/scan/test
welcome wxpod999zjtest7-haproxy:/root#
zjtest7-haproxy:/root# curl api.zjtest7.com:8001/scan/index.html
abc20161216123dasd-9ad-0-a09
一样没有问题;
换成 hdr_dom(host)
acl zjtest7_com hdr_dom(host) -i zjtest7.com
use_backend zjtest7_com if zjtest7_com
acl api_zjtest7_com hdr_dom(host) -i api.zjtest7.com
use_backend api_zjtest7_com if api_zjtest7_com
zjtest7-haproxy:/root# curl zjtest7.com/scan/test
welcome wxpod999zjtest7-haproxy:/root#
zjtest7-haproxy:/root#
zjtest7-haproxy:/root#
zjtest7-haproxy:/root# curl api.zjtest7.com:8001/scan/index.html
abc20161216123dasd-9ad-0-a09
acl monitor hdr_beg(host) -i monitor.test.com #定义ACL名称,对应的请求的主机头是monitor.test.com
acl bbs hdr_reg(host) -i ^(bbs.test.com|forum.test.com) #使用正则匹配
hdr_beg(host) hdr_reg(host) hdr_dom(host)的更多相关文章
- 对比各节点host 与 标准节点host差异脚本
把各节点host拷贝到一台节点 这可以采用读主机名配置的方式 我这里偷懒了 echo 'starting' ssh hadoop01 "cp /etc/hosts ~/hadoop01-ho ...
- xshell连接不了虚拟机处理方法(错误提示:Connection closing...Socket close.Connection closed by foreign host.Disconnected from remote host(localhost) at 08:47:23.)
一.问题描述:xshell连接不了虚拟机,出现错误提示:Connection closing...Socket close.Connection closed by foreign host.Disc ...
- [Linux] Telnet提示:Unable to connect to remote host: No route to host
出错现象: [root@localhost ~]# telnet 192.168.1.128 Trying 192.168.1.128...telnet: connect to address 192 ...
- [转]php curl 设置host curl_setopt CURLOPT_HTTPHEADER 指定host
From : http://digdeeply.org/archives/10132139.html 我们在开发测试时,有时web服务器会绑定一个域名,但是因为dns是无法解析的,我们需要设置host ...
- Connection closing...Socket close. Connection closed by foreign host. Disconnected from remote host(centos6.9) at 14:59:05.
查找网上资料解决方法如下 [root@localhost ssh]# service sshd start Starting sshd: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ...
- 开发环境绑定host vue 返回 invalid host header
事情:使用域名绑定host为本机电脑ip,vue返回 invalid host header 原因:新版的webpack-dev-server出于安全考虑,默认检查hostname,如果hostnam ...
- jenkins centos slave起不来报错The SSH key presented by the remote host does not match the key saved in the Known Hosts file against this host. Connections to this host will be denied until the two keys mat
场景:我的centos-204是一台centos的机器,本来用https://www.cnblogs.com/zndxall/p/8297356.html 的centos slave方式搭建ok的,一 ...
- win8.1 host被删,host无法修改,host无法复制进去解决方案
1.C:\Windows\System32\drivers\etc\hosts 复制到桌面 2.删除C:\Windows\System32\drivers\etc\hosts 3.右键编辑文本--& ...
- telnet: Unable to connect to remote host: No route to host
用iptables -F这个命令来关闭防火墙,但是使用这个命令前,千万记得用iptables -L查看一下你的系统中所有链的默认target,iptables -F这个命令只是清除所有规则,只不会真正 ...
随机推荐
- 通用SQL存储过程分页以及asp.net后台调用
创建表格并添加300万数据 use Stored CREATE TABLE UserInfo( --创建表 id ,) PRIMARY KEY not null,--添加主键和标识列 UserName ...
- [DevExpress]设置RepositoryItemComboBox只可下拉选择不可编辑
将TextEditStyle属性设置如下即可: 希望有所帮助!
- jQuery(function($){...})与(function($){...})(jQuery)知识点分享
写jQuery插件时一些经验分享一下. 一.推荐写法 jQuery(function($){ //coding }); 全写为 jQuery(document).ready(function($){ ...
- 多线程的单元测试工具 - GroboUtils
写过Junit单元测试的同学应该会有感觉,Junit本身是不支持普通的多线程测试的,这是因为Junit的底层实现上,是用System.exit退出用例执行的.JVM都终止了,在测试线程启动的其他线程自 ...
- Python时间和日期学习
#coding=utf-8 __author__ = 'Administrator' #日期和时间模块学习 """ Python程序能用很多方式处理日期和时间,转换日期格 ...
- PAT乙级真题1006. 换个格式输出整数 (15)(解题)
原题: 让我们用字母B来表示“百”.字母S表示“十”,用“12...n”来表示个位数字n(<10),换个格式来输出任一个不超过3位的正整数.例如234应该被输出为BBSSS1234,因为它有2个 ...
- 微信支付配置信息,JSAPI接口,H5调用微信js接口支付,微信公众号支付
微信支付已经做完了,没接触过微信的我,经历了非常艰难的3天,才把微信支付给做出来,对于专业的人来说,估计就是一小时就搞定的事情了,虽然说做了很长时间,但是确实也学到东西了,也收获了不少,下面跟大家分享 ...
- POJ 3701 概率DP
给定2^n 支足球队进行比赛,n<=7. 队伍两两之间有一个获胜的概率,求每一个队伍赢得最后比赛的概率是多少? 状态其实都是很显然的,一开始觉得这个问题很难啊,不会.dp[i][j] 表示第i支 ...
- 1.2 XmlBeanFactory的实例化
源代码分析,是一件既痛苦又快乐的事情,看别人写的代码是通过的,但当你能够看明白的时候,相信快乐也会随之而来,为了减少痛苦,更快的带来快乐, 本文以spring框架的XmlBeanFactory为入手点 ...
- window live writer的曲折安装过程
之前一直使用windows live writer2012写日志,由于之前重装了系统,所以需要重新安装writer,本以为是一个很简单的过程,你就是安装个软件吗.... 然而事实是... ...