path_beg : prefix match  前缀匹配
path_dir : subdir match
path_dom : domain match
path_end : suffix match 后缀匹配 path : string
This extracts the request's URL path, which starts at the first slash and
ends before the question mark (without the host part). A typical use is with
prefetch-capable caches, and with portals which need to aggregate multiple
information from databases and keep them in caches. Note that with outgoing
caches, it would be wiser to use "url" instead. With ACLs, it's typically
used to match exact file names (eg: "/login.php"), or directory parts using
the derivative forms. See also the "url" and "base" fetch methods. 提取请求的URL 的path,以第一个/开始和 在问号前结束(没有主机部分) 一个典型的使用是在预取caches, 和许多门户网站需要集合多个信息从数据库, 把它们放在cache里。 path_beg 用于测试请求的URI是否以指定的模式开头。 第一个/开始 http://120.55.118.6:3000/admin/api/menu http://120.55.118.6:3000/admin/api/test http://www.hyyche.com/admin/api/test [root@wx03 mojo]# cat test.pl
use Mojolicious::Lite;
use JSON qw/encode_json decode_json/;
use Encode;
no strict;
use JSON; # /foo?user=sri
get '/admin/api/menu' => sub {
my $c = shift; $c->render(text => "welcome /admin/api/menu" );
}; get '/admin/api/test' => sub {
my $c = shift; $c->render(text => "welcome /admin/api/test" );
}; app->start; 请求带/admin开头的都转发到 相应的机器

haproxy path_beg的更多相关文章

  1. haproxy windows环境使用

    haproxy下载:http://pan.baidu.com/s/1miEvQUc 测试环境说明: ip地址 作用 开放端口 备注 nbproc 1 daemon defaults mode tcp ...

  2. HAProxy的日志配置以及ACL规则实现负载均衡

    HAProxy配置日志策略 默认情况下,HAProxy是没有配置日志的在centos6.3下默认管理日志的是rsyslog,可以实现UDP日志的接收,将日志写入文件,写入数据库先检测rsyslog是否 ...

  3. CentOS7—HAProxy安装与配置

    概述 Haproxy下载地址:http://pkgs.fedoraproject.org/repo/pkgs/haproxy/ 关闭SElinux.配置防火墙 1.vi /etc/selinux/co ...

  4. 构建高可用集群Keepalived+Haproxy负载均衡

    重点概念vrrp_script中节点权重改变算法vrrp_script 里的script返回值为0时认为检测成功,其它值都会当成检测失败:weight 为正时,脚本检测成功时此weight会加到pri ...

  5. HAProxy学习笔记

    HAProxy:著名的负载均衡器,工作于用户空间的服务程序,其有两种工作模式: TCP mode:四层调度(模拟实现,依赖于socket进行通信) HTTP mode:七层调度 目前维护的稳定版本分支 ...

  6. Haproxy+Keepalived高可用负载均衡详细配置

    本文所使用的环境: 10.6.2.128    centos6.5 10.6.2.129    centos6.5 VIP  为10.6.2.150 要实现的目标: 实现10.6.2.128和10.6 ...

  7. Haproxy安装配置及日志输出问题

    简介: 软件负载均衡一般通过两种方式来实现:基于操作系统的软负载实现和基于第三方应用的软负载实现.LVS就是基于Linux操作系统实现的一种软负载,HAProxy就是开源的并且基于第三应用实现的软负载 ...

  8. HAProxy安装及初步使用

    1.yum安装wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmrpm -ivh epel-r ...

  9. CentOS6.5 安装HAProxy 1.5.20

    [在CentOS下安装haproxy] sudo yum install haproxy 编辑配置文件 vim /etc/haproxy/haproxy.cfg #------------------ ...

随机推荐

  1. 【转】Configuring VM Acceleration on Linux

    Configuring VM Acceleration on Linux Linux-based systems support virtual machine acceleration throug ...

  2. ADO.NET(一) 空间 ADO.NET结构 命名空间(车延禄) System.Data—— 所有的一般数据访问类 S(转载)

    ADO.NET(一) 空间   ADO.NET结构 命名空间(车延禄)System.Data—— 所有的一般数据访问类System.Data.Common—— 各个数据提供程序共享(或重写)的类Sys ...

  3. Informatica 9.5.1 安装配置

    Informatica  结构 1个或多个资源库(Respository) PowerCenter数据整合引擎是基于元数据驱动的,提供了基于数据驱动的元数据知识库(Repository),该元数据知识 ...

  4. Linux命令压缩与解压缩

    zip格式的文件:zip和unzip zip 命令: # zip test.zip test.txt 它会将 test.txt 文件压缩为 test.zip ,当然也可以指定压缩包的目录,例如 /ro ...

  5. eclipse安装PyDev插件出错No software site found at jar:file:[离线包路径]!/. Do you wish to edit the location?

    解决方法是直接将下载的离线包解压,得到plugins和features文件夹,放到Eclipse的dropins目录下.重启Eclipse,PyDev插件即可安装成功. 离线包下载地址:http:// ...

  6. MongoDB学习笔记1(简介)

    一.简介                 1.丰富的数据类型         MongoDB是一种非关系型数据库,是面向文档的数据库.         MongoDB没有模式,文档的键不会事先定义,也 ...

  7. Qt 技巧:设置在 debug 路径下直接运行可执行文件

    Qt 编译的时候默认会使用影子构建,这时在工作路径下会生成一个目录:xxx-build-desktop-xxx. 如果编译通过,在该目录下会生成一个可执行文件,双击之,但不能运行,提示是缺少某个动态库 ...

  8. 梳排序(Comb sort)

    Comb Sort,梳排序或者梳子排序,就像梳子那样有间隔地比较两个数,很形象,O(n*logn)时间复杂度,O(1)空间复杂度,属于不稳定的排序算法.算法的思想是使逆序的元素尽可能快地移动到最终的位 ...

  9. pkusc2015

    Mex 题目大意:给出一个序列\(a\),定义\(f(l,r)\)为集合{\(a_l, a_{l+1}, -, a_r\)}的sg值,求\(\sum_i \sum_{j(i\leq j)} f(i,j ...

  10. poj 1442 Black Box(优先队列&Treap)

    题目链接:http://poj.org/problem?id=1442 思路分析: <1>维护一个最小堆与最大堆,最大堆中存储最小的K个数,其余存储在最小堆中; <2>使用Tr ...