<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位安装Chrome浏览器

    下载链接:translate.google.com.hk/translate?hl=zh-CN&sl=en&u=http://95.31.35.30/chrome/pool/main/ ...

  2. T-SQL 语法元素

    一.标识符 在T-SQL语言中,对SQLServer数据库及其数据对象(比如表.索引.视图.存储过程.触发器等)需要以名称来进行命名并加以区分,这些名称就称为标识符. 通常情况下,SQLServer数 ...

  3. 私有静态方法private static method-值得用吗?

    用Resharper的同学都知道,如果你写了一个私有函数,这个函数没有访问类里面的其他参数和方法,那么它建议你标记这个方法为私有静态方法,提示是这样的: 值得这样做吗?看看微软的建议: After y ...

  4. FZU1862(线段树 或者 DP)

    Problem 1862 QueryProblem Accept: 100    Submit: 249Time Limit: 2000 mSec    Memory Limit : 32768 KB ...

  5. 一个非常给力的播放器video-js

    video-js采用的是html5播放器. 在不支持html5的浏览器会自动切换成flash. video-js的官网http://www.videojs.com/ 看看下载的demo就知道个大概了. ...

  6. [Python笔记][第三章Python选择与循环]

    1月28日学习 Python选择与循环 选择结构 多分枝选择结构 if 表达式 1: 语句块 1 elif 表达式 2: 语句块 2 elif 表达式 3: 语句块 3 ... else : 语句块 ...

  7. HDU2093 字符串2种不错的读入思路

    <span style="font-family: 'Times New Roman'; font-size: 12px; background-color: rgb(255, 255 ...

  8. 批处理Bat实现整合定时关机或取消定时关机

    @echo off :start choice /c:12 /m "输入1为设置定时关机,2为取消定时关机: " if errorlevel 2 goto cancel if er ...

  9. [AngularJS系列(4)] 那伤不起的provider们啊~ (Provider, Value, Constant, Service, Factory, Decorator)(转)

    用AngularJS做项目,但凡用过什么service啊,factory啊,provider啊,开始的时候晕没晕?!晕没晕?!感觉干的事儿都差不多啊,到底用哪个啊?!别告诉我你们几个就是为了跟我炫耀兄 ...

  10. c# 面相对象2-之封装性

    一.封装特性: 这是一种隐藏的特性.可以用一个公式来展示类的封装特性: 封装的类=数据  +  对此数据进行的操作(即算法) 通俗的说,封装就是:包起外界不必要知道的东西,只向外界展露可供展示的东西. ...