<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
												

haproxy image跳转 haproxy匹配 匹配到了就停止,不会继续往下匹配的更多相关文章

  1. Haproxy 重定向跳转设置 - 运维小结

    前面已经详细介绍了Haproxy基础知识 , 今天这里再赘述下Haproxy的重定向跳转的设置.  haproxy利用acl来实现haproxy动静分离,然而在许多运维应用环境中,可能需要将访问的站点 ...

  2. js进阶正则表达式9量词2(^和&作用:/^HTML5$/g匹配不到aHTML5b中的HTML5,不然是可以匹配到的)(/\d+(?=cm)/g)((?!cm))

    js进阶正则表达式9量词2(^和&作用:/^HTML5$/g匹配不到aHTML5b中的HTML5,不然是可以匹配到的)(/\d+(?=cm)/g)((?!cm)) 一.总结 ^和&作用 ...

  3. 多个haproxy 之间跳转

    C:\>ping wechatTest.winfae.com 正在 Ping wechatTest.winfae.com [120.55.118.6] 具有 32 字节的数据: 来自 120.5 ...

  4. haproxy /admin跳转 不会在接口上再次加上admin

    http://www.xx.com/admin/api/menu [root@wx03 mojo]# cat test.pl use Mojolicious::Lite; use JSON qw/en ...

  5. 在ibatis下匹配特殊手机号码(oracle数据库)

    <isNotNull prepend="AND" property="endNumber"> <isNotEmpty property=&qu ...

  6. 请实现一个函数用来匹配包括'.'和'*'的正则表达式。模式中的字符'.'表示任意一个字符,而'*'表示它前面的字符可以出现任意次(包含0次)。 在本题中,匹配是指字符串的所有字符匹配整个模式。例如,字符串"aaa"与模式"a.a"和"ab*ac*a"匹配,但是与"aa.a"和"ab*a"均不匹配

    // test20.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include<iostream> #include< ...

  7. haproxy笔记之三:配置HAProxy详细介绍

    2.1 配置文件格式 HAProxy的配置处理3类来主要参数来源:——最优先处理的命令行参数,——“global”配置段,用于设定全局配置参数:——proxy相关配置段,如“defaults”.“li ...

  8. haproxy笔记之二:HAProxy简介

    HAProxy提供高可用性.负载均衡以及基于TCP和HTTP应用的代理,支持虚拟主机,它是免费.快速并且可靠的一种解决方案.HAProxy特别适用于那些负载特大的web站点,这些站点通常又需要会话保持 ...

  9. 【VS2019】F12跳转到源码,关闭浏览器不停止项目【转】

    [VS2019]F12跳转到源码 1.工具->选项 2.文本编辑器->C#->高级->勾选支持导航到反编译源码 3.关闭浏览器不停止项目

随机推荐

  1. Ubuntu14.0.4 64位 ADT 连接手机调试问题

    1:使用 lsusb 命令查看USB 设备 y@y:~$ lsusbBus 001 Device 002: ID 8087:8000 Intel Corp. Bus 001 Device 001: I ...

  2. C# Stopwatch类_性能_时间计时器

    在研究性能的时候,完全可以使用Stopwatch计时器计算一项技术的效率.但是有时想知道某想技术的性能的时候,又常常想不起可以运用Stopwatch这个东西,太可悲了. 属性: Elapsed 获取当 ...

  3. Scala 函数(五)

    函数是一组一起执行一个任务的语句. 您可以把代码划分到不同的函数中.如何划分代码到不同的函数中是由您来决定的,但在逻辑上,划分通常是根据每个函数执行一个特定的任务来进行的. Scala 有函数和方法, ...

  4. Unity Scene为每一个游戏物体进行扩展编辑

    2个月前还在忙碌的找实习工作,看见招聘信息上面有一条熟悉扩展Unity编辑器,配合美工编程. 自己动手写完这个代码时候,发现写代码就像弹钢琴多么神奇. TestEdit类: using UnityEn ...

  5. JDK5新特性之线程同步集合(五)

    一. 传统集合: 传统方式下的Collection在迭代集合时, 不同意对集合进行改动: public class CollectionModifyExceptionTest { public sta ...

  6. cocos2d-x-2.2.5项目创建--命令行创建

    Gavin:downloads DavidLik$ cd cocos2d-x-2.2.5/ Gavin:cocos2d-x-2.2.5 DavidLik$ cd tools/ Gavin:tools ...

  7. Android 的权限设置大全

    android.permission.ACCESS_CHECKIN_PROPERTIES //同意读写訪问"properties"表在checkin数据库中.改值可以改动上传 an ...

  8. 9. iptables 配置

    iptables 配置文件存放位置:  [root@Demon yum.repos.d]# vim /etc/rc.d/init.d/iptables   一.只给 Centos 6.5 打开 22 ...

  9. ionic安装

    npm set registry http://registry.cnpmjs.org/ 设置淘宝镜像

  10. margin四个属性的顺序

    margin-top ,margin-right ,margin-bottom ,margin-left .方向为 上右下左,顺时针方向, 值可以是: 百分比(基于父对象总高度或宽度的百分比) 长度值 ...