zoukankan      html  css  js  c++  java
  • haproxy image跳转 haproxy匹配 匹配到了就停止,不会继续往下匹配

    <pre name="code" class="html">/***第一种
    nginx 配置:
         location / {
                root /var/www/zjzc-web-frontEnd;
                index  index.html;
            }
    
    zjtest7-frontend:/var/www/zjzc-web-frontEnd/images# pwd
    /var/www/zjzc-web-frontEnd/images
    zjtest7-frontend:/var/www/zjzc-web-frontEnd/images# ls
    3.png
    
    http://192.168.32.76:8001/images/3.png
    
    
    
    haproxy:
    
    
        acl            image_req                path_beg                -i                      /images
            use_backend     imageserver_8001          if                      image_req
    
    
            backend imageserver_8001
                    mode            http
            balance         roundrobin
            server          webhost01_8001          192.168.32.76:8001     check inter 2000 fall 3 weight 20
    
    
    haproxy 如果有这行就不行
      #acl             url_static_zjdev        path_end                                            .html .gif .png .jpg .css .js 注释掉这行
    
    /*******************
    frontend web_service
    	bind	*:80
         
         	acl 		api_req    		path_beg    		-i 			/api
    	use_backend 	appserver_8082 		if	    		api_req
    
            acl            image_req                path_beg                -i                      /images
            use_backend     imageserver_8001          if                      image_req
    
                acl             url_static              path_end                .html .gif .png .jpg .css .js
            use_backend     webserver_8001          if                      url_static
            backend imageserver_8001
                    mode            http
            balance         roundrobin
            server          webhost01_8001          192.168.32.76:8001     check inter 2000 fall 3 weight 20
            
    
    
    
           backend	webserver_8001
    	mode    	http
    	balance		roundrobin
    	server  	webhost01_8001		192.168.32.213:8001     check inter 2000 fall 3 weight 20
    	#server  	webhost02_8001		192.168.32.214:8001     check inter 2000 fall 3 weight 20
    
         backend appserver_8082
            mode            http
            balance         roundrobin
            server          apphost01_8082          192.168.32.215:8082      check inter 2000 fall 3
    
    
    先匹配到/images 就不会继续往下匹配
    
    
    
    
    frontend web_service
    	bind	*:80
         
         	acl 		api_req    		path_beg    		-i 			/api
    	use_backend 	appserver_8082 		if	    		api_req
            acl             url_static              path_end                .html .gif .png .jpg .css .js
            use_backend     webserver_8001          if                      url_static
    
    
            acl            image_req                path_beg                -i                      /images
            use_backend     imageserver_8001          if                      image_req
    
            backend imageserver_8001
           mode            http
            balance         roundrobin
            server          webhost01_8001          192.168.32.76:8001     check inter 2000 fall 3 weight 20
            
    
    
    
           backend	webserver_8001
    	mode    	http
    	balance		roundrobin
    	server  	webhost01_8001		192.168.32.213:8001     check inter 2000 fall 3 weight 20
    	#server  	webhost02_8001		192.168.32.214:8001     check inter 2000 fall 3 weight 20
    
         backend appserver_8082
            mode            http
            balance         roundrobin
            server          apphost01_8082          192.168.32.215:8082      check inter 2000 fall 3
    
    
    这样情况
    
    http://www.zjtest7.com/images/3.png 就访问不到了,因为先匹配了path_end 


    
                                        
    
  • 相关阅读:
    推荐网址:Response.WriteFile Cannot Download a Large File
    为什么是 My?
    Fox开发杂谈
    DCOM配置为匿名访问
    连接到运行 Windows 98 的计算机
    OO面向对象以后是什么
    Com+的未来是什么?
    fox 表单和类库的加密及修复
    来自 COM 经验的八个教训
    VFP的加密问题
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350346.html
Copyright © 2011-2022 走看看