haproxy 规则匹配到了就停止,不会继续匹配下一个

来源:互联网 发布:淘宝上的车秒贷靠谱吗 编辑:程序博客网 时间:2024/04/28 04:00
      acl             url_web_wwm             path_beg                -i                      /scan      use_backend    zjtest7_com          if                                     url_web_wwm        acl             url_static              path_end                .html .gif .png .jpg .css .js        use_backend     api_zjtest7_com          if                      url_static               backend zjtest7_com       mode    http       server  apphost_1192.168.32.101:3000  check inter 2000 fall 3              backend api_zjtest7_com       mode     http       server   apphost_1               192.168.32.76:80     check inter 2000 fall 3              backend image_zjtest7_com       mode     http       server   apphost_1               192.168.32.61:80     check inter 2000 fall 3其中 zjtest7.com 和api.zjtest7.com 都指向到haproxyzjtest7-haproxy:/root# curl zjtest7.com/scan  此时发送到 zjtest7_com 而不会发送到 api_zjtest7_com zjtest7-haproxy:/root# curl api.zjtest7.com/scan/index.htmlzjtest7-haproxy:/root# curl zjtest7.com/scan/testwelcome wxpod999zjtest7-haproxy:/root# /case 1*********************************      acl             url_static              path_end                .html .gif .png .jpg .css .js        use_backend     api_zjtest7_com          if                      url_static            acl             url_web_wwm             path_beg                -i                      /scan      use_backend    zjtest7_com          if                                     url_web_wwmzjtest7-haproxy:/root# curl api.zjtest7.com/scan/index.htmlnginx01-192.168.32.76 20161218此时可以访问 因为先匹配到了 path_end ,没有继续往下匹配 不然 就会匹配scan 而无法访问/case 2***********************************      acl             url_web_wwm             path_beg                -i                      /scan      use_backend    zjtest7_com          if                                     url_web_wwm            acl             url_static              path_end                .html .gif .png .jpg .css .js        use_backend     api_zjtest7_com          if                      url_staticzjtest7-haproxy:/root# curl api.zjtest7.com/scan/index.html此时先匹配到了 /scan 没有继续往下 匹配  去访问zjtest7_com了 所以访问不到

0 0
原创粉丝点击