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)的更多相关文章

  1. 对比各节点host 与 标准节点host差异脚本

    把各节点host拷贝到一台节点 这可以采用读主机名配置的方式 我这里偷懒了 echo 'starting' ssh hadoop01 "cp /etc/hosts ~/hadoop01-ho ...

  2. 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 ...

  3. [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 ...

  4. [转]php curl 设置host curl_setopt CURLOPT_HTTPHEADER 指定host

    From : http://digdeeply.org/archives/10132139.html 我们在开发测试时,有时web服务器会绑定一个域名,但是因为dns是无法解析的,我们需要设置host ...

  5. 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: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ...

  6. 开发环境绑定host vue 返回 invalid host header

    事情:使用域名绑定host为本机电脑ip,vue返回 invalid host header 原因:新版的webpack-dev-server出于安全考虑,默认检查hostname,如果hostnam ...

  7. 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的,一 ...

  8. win8.1 host被删,host无法修改,host无法复制进去解决方案

    1.C:\Windows\System32\drivers\etc\hosts  复制到桌面 2.删除C:\Windows\System32\drivers\etc\hosts 3.右键编辑文本--& ...

  9. telnet: Unable to connect to remote host: No route to host

    用iptables -F这个命令来关闭防火墙,但是使用这个命令前,千万记得用iptables -L查看一下你的系统中所有链的默认target,iptables -F这个命令只是清除所有规则,只不会真正 ...

随机推荐

  1. xamarin android——数据绑定到控件(一)

    mono for android 中光标由ICursor 接口标识,该接口公开了操作结果数据集的所有方法.光标的使用非常消耗系统资源,所以不使用时应该光比光标.可以通过StartManagingCur ...

  2. web组件新学--layer

    在之前项目后台管理界面开发中,不知道有layer这样好用的组件,我的内心是这样的的...呀!这个框架有弹框,哈哈哈,好开心,不用自己写遮罩层,不用自己写弹框,好开森.. 当知道有layer之后.... ...

  3. JS如何获取iframe内html的body值

    default页面: <html> <head> <script type="text/javascript"> window.onload=f ...

  4. 一些dos命令

    MS DOS 命令大全 一.基础命令 1 dir 无参数:查看当前所在目录的文件和文件夹. /s:查看当前目录已经其所有子目录的文件和文件夹. /a:查看包括隐含文件的所有文件. /ah:只显示出隐含 ...

  5. php curl基本操作

    如何使用cURL的基本方法?首先,修改php.ini文件的设置,找到php_curl.dll,取消下在的注释extension=php_curl.dll,因为php默认是不开启cURL的. cURL是 ...

  6. JavaScript 高级程序设计 01-基本概念

    一.JavaScript组成 1.一个完成JavaScript是由ECMAScript.DOM.BOM三部分组成的. ECMAScript:提供核心语言功能--语法.类型.语句.关键字.保留字.操作符 ...

  7. laravel扩展Debugbar

    github地址:https://github.com/barryvdh/laravel-debugbar

  8. 2W/月和1W/月的工作,你会怎么选?

    只看标题的话,肯定有不少人会选择月薪 2W 的工作,很明显,钱多嘛!但实际上,这里是有前提的,完整的问题如下: 一份月薪 2W,但加班无底线,基本没有自由时间的工作,和一份月薪 1W,但正常工作时长, ...

  9. foxtable使用笔记

    1.设置关联表窗口的列的顺序:Tables("award.people").SetColVisibleWidth("name|100|sex|100|job|100|ag ...

  10. Kakfa揭秘 Day7 Producer源码解密

    Kakfa揭秘 Day7 Producer源码解密 今天我们来研究下Producer.Producer的主要作用就是向Kafka的brokers发送数据.从思考角度,为了简化思考过程,可以简化为一个单 ...