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这个命令只是清除所有规则,只不会真正 ...
随机推荐
- GDB 进行调试 使用心得
GDB 进行调试 使用心得 转 1: 对于在应用程序中加入参数进行调试的方法: 直接用 gdb app -p1 -p2 这样进行调试是不行的. 需要像以下这样使用: #gdb app ...
- 登堂入室——java流
——文章出自PeterYe,不得私自转载 我所知道的 java.io里面的[流],就仿佛太平洋里面的水一样,浩浩荡荡,横无际涯... -----2016/7/16--------公寓处记录------ ...
- java 枚举 类 enum
public abstract class Enum<E extends Enum<E>> implements Comparable<E>, Serializab ...
- hadoop下跑mapreduce程序报错
mapreduce真的是门学问,遇到的问题逼着我把它从MRv1摸索到MRv2,从年前就牵挂在心里,连过年回家的旅途上都是心情凝重,今天终于在eclipse控制台看到了job completed suc ...
- java的CyclicBarrier
CyclicBarrier直译叫循环屏障,作用有点像赛跑时吹哨的角色,它有2个构造方法,一个是int的arg1,另一个多了一个Runable的arg2 arg1:可以看做此次参加赛跑的人数 arg2: ...
- linux计划任务运行php文件的方法分享
在linux下,借助crontab,设置计划任务每天6点10分执行filename.php文件,写入一行时间到log日志中. 创建计划任务的脚本: dos2unix /path/to/filename ...
- pdo 连接数据库 报错 could not find driver 解决方法
在windows 下,调试一个PHP程序时,报了这个错误, could not find driver 原来我的这个程序中用到了PDO对象, 连接mysql 5. 在PHP的默认设置中,只打开了ph ...
- Linux安装oracle 10g常见问题之——ORA-01078,LRM-00109,ORA-01102
[oracle@toughhou database]$ sqlplus /nolog SQL> conn / as sysdba SQL> startup ORA-01078: failu ...
- sql表连接left join,right join,inner join三者之间的区别
sql表连接left join,right join,inner join区别 left join(左联接) 返回包括左表中的所有记录和右表中联结字段相等的记录 (以左表数据为基准,不足补为NULL) ...
- EXTJS 4.2 日期控件
{ xtype: "fieldcontainer", layout: "hbox", items: [{ fieldLabel: '开始时间', name: ' ...