zoukankan      html  css  js  c++  java
  • haproxy 规则匹配到了就停止,不会继续匹配下一个

          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_1		192.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 都指向到haproxy
    
    
    zjtest7-haproxy:/root# curl zjtest7.com/scan  此时发送到 zjtest7_com 而不会发送到 api_zjtest7_com 
    
    
    zjtest7-haproxy:/root# curl api.zjtest7.com/scan/index.html
    
    
    zjtest7-haproxy:/root# curl zjtest7.com/scan/test
    welcome 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_wwm
    
    zjtest7-haproxy:/root# curl api.zjtest7.com/scan/index.html
    nginx01-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_static
    
    
    zjtest7-haproxy:/root# curl api.zjtest7.com/scan/index.html
    
    此时先匹配到了 /scan 没有继续往下 匹配  去访问zjtest7_com了 所以访问不到

  • 相关阅读:
    对bootstrap不同版本的总结
    对于前后端分离的理解
    css3笔记
    Dom
    js菜单
    css兼容问题 ie6,7
    html知识
    前端基础知识
    前端要注意的代码规范
    bootstrap常见类的总结
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6198922.html
Copyright © 2011-2022 走看看