<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. Uubntu scrot 的简单使用

    scrot 是一个使用 imlib2 库截取屏幕和保存图像的的工具. 1:安装 #apt-get install scrot 2:查看帮助 #scrot -help -v, --version显示版本 ...

  2. Apache Commons Pool2 源码分析 | Apache Commons Pool2 Source Code Analysis

    Apache Commons Pool实现了对象池的功能.定义了对象的生成.销毁.激活.钝化等操作及其状态转换,并提供几个默认的对象池实现.在讲述其实现原理前,先提一下其中有几个重要的对象: Pool ...

  3. 实现action的三种方法

    1.一个普通的类 public class testAction1 { public String execute(){ return "success"; } } 2.实现Act ...

  4. catkin_simple 的使用

    Catkin simple 可用于规范catkin package, 并简化CMakeLists  Dependencies are just listed once as build-depend  ...

  5. c# 高斯模糊

    using System; using System.Collections.Generic; using System.Text; using System.Drawing; using Syste ...

  6. 放弃使用jQuery实现动画

    在Web开发的圈子里,开发人员经常觉得CSS动画是一种高性能web动画技术.假设想让网页载入的更快一些,就应该用纯CSS动画.事实上这样的观点是错误的,非常多开发人员早就放弃了javascript的动 ...

  7. windows下启动/关闭Sybase数据库服务器

    启动.关闭Sybase数据库服务器 一.启动Sybase服务器 在windows下介绍两种方法启动Sybase数据库服务器. 1.通过服务器管理器 依次打开控制面板>管理工具>服务 管理窗 ...

  8. ubuntu WiFi: operation not possible due to RF-kill《转载》

    Some people have been experiencing WiFi problems with Ubuntu 10.10 since an update that happend just ...

  9. gauge.js的应用

    最近项目要做个手机端的仪表盘,但是画风太给力,echarts.highcharts.D3等等都不能满足业务的需求,你懂的!开找,找到个gauge.js 下面简单介绍下这个插件官网http://bern ...

  10. 几个因为hadoop配置文件不当造成的错误

    192.168.1.20: Exception in thread "main" java.lang.IllegalArgumentException 192.168.1.20: ...