• 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 


    
       
    
    
  • 相关阅读:
    利用集群因子优化
    HighCharts之2D对数饼图
    HighCharts之2D回归直线的散点
    HighCharts之2D柱状图、折线图的组合多轴图
    Oracle Data Guard_ 主库添加或删除在线重做日志文件
    Oracle Data Guard_ 主库重命名数据文件
    Oracle Data Guard_ 主备库传输表空间
    打开页面报错
    HighCharts之2D柱状图、折线图的组合双轴图
    HighCharts之2D柱状图、折线图和饼图的组合图
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199295.html
Copyright © 2020-2023  润新知