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. SQL Server数据库连接类SQLHelper.cs

    using System; using System.Collections.Generic; using System.Text; using System.Configuration; using ...

  2. 利用ApnsPHP包向IOS推送消息

    header('content-type:text/html;charset=utf-8'); require_once 'ApnsPHP/Autoload.php'; require_once 'A ...

  3. Spark机器学习 Day2 快速理解机器学习

    Spark机器学习 Day2 快速理解机器学习 有两个问题: 机器学习到底是什么. 大数据机器学习到底是什么. 机器学习到底是什么 人正常思维的过程是根据历史经验得出一定的规律,然后在当前情况下根据这 ...

  4. Beaglebone Back学习七(URAT串口测试)

    URAT串口测试

  5. win32进程间通讯--共享内存

    小白一枚,如有不对,请各位大神多多指教! 最近看了看win32进程间通讯.简单写了写利用共享内存实现进程间通讯 使用共享内存实现进程间通讯: 1.在WM_CREATE消息下创建文件映射内核对象 hMa ...

  6. butterknife7.0.1使用

    1.官网:http://jakewharton.github.io/butterknife/ Introduction Annotate fields with @Bind and a view ID ...

  7. Sambar,实现Linux和Windows共享

    我下载的是tar的jar包,不是rpm,rpm就不多说了.目的是让Windows能够共享Linux系统的文件夹 1.进入到source文件夹: 2../configure->make->m ...

  8. Windows.Andy.Code4App.dll Win8.1/WP8.1通用类库@ver1.0.1

    在上篇 Windows.Andy.Code4App.dll  Win8.1/WP8.1通用类库@ver1.0.0 已经对Win8.1和WP8.1部分扩展通用类库做了说明,这篇继续对通用类库做扩展.写的 ...

  9. IOS UIVIEW layer动画 总结(转)

    转发自:http://www.aichengxu.com/article/%CF%B5%CD%B3%D3%C5%BB%AF/16306_12.html   IOS UIVIEW layer动画 总结, ...

  10. 1.2 XmlBeanFactory的实例化

    源代码分析,是一件既痛苦又快乐的事情,看别人写的代码是通过的,但当你能够看明白的时候,相信快乐也会随之而来,为了减少痛苦,更快的带来快乐, 本文以spring框架的XmlBeanFactory为入手点 ...