haproxy path_beg
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的更多相关文章
- haproxy windows环境使用
haproxy下载:http://pan.baidu.com/s/1miEvQUc 测试环境说明: ip地址 作用 开放端口 备注 nbproc 1 daemon defaults mode tcp ...
- HAProxy的日志配置以及ACL规则实现负载均衡
HAProxy配置日志策略 默认情况下,HAProxy是没有配置日志的在centos6.3下默认管理日志的是rsyslog,可以实现UDP日志的接收,将日志写入文件,写入数据库先检测rsyslog是否 ...
- CentOS7—HAProxy安装与配置
概述 Haproxy下载地址:http://pkgs.fedoraproject.org/repo/pkgs/haproxy/ 关闭SElinux.配置防火墙 1.vi /etc/selinux/co ...
- 构建高可用集群Keepalived+Haproxy负载均衡
重点概念vrrp_script中节点权重改变算法vrrp_script 里的script返回值为0时认为检测成功,其它值都会当成检测失败:weight 为正时,脚本检测成功时此weight会加到pri ...
- HAProxy学习笔记
HAProxy:著名的负载均衡器,工作于用户空间的服务程序,其有两种工作模式: TCP mode:四层调度(模拟实现,依赖于socket进行通信) HTTP mode:七层调度 目前维护的稳定版本分支 ...
- 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 ...
- Haproxy安装配置及日志输出问题
简介: 软件负载均衡一般通过两种方式来实现:基于操作系统的软负载实现和基于第三方应用的软负载实现.LVS就是基于Linux操作系统实现的一种软负载,HAProxy就是开源的并且基于第三应用实现的软负载 ...
- HAProxy安装及初步使用
1.yum安装wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmrpm -ivh epel-r ...
- CentOS6.5 安装HAProxy 1.5.20
[在CentOS下安装haproxy] sudo yum install haproxy 编辑配置文件 vim /etc/haproxy/haproxy.cfg #------------------ ...
随机推荐
- 使用VS创建WebPart部件,并部署到SP(待修改)
http://www.cnblogs.com/mingmingruyuedlut/archive/2012/12/02/2789488.html
- JavaScript基础知识----六道有趣的Js基础题以及解答
题目: 1.找出数字数组中最大的元素(使用Math.max函数)2.转化一个数字数组为function数组(每个function都弹出相应的数字)3.给object数组进行排序(排序条件是每个元素对象 ...
- Java疯狂讲义(二)
- spring bean管理 笔记1
轻量级,无侵入 Bean管理 1 创建applicationContext.xml 2 配置被管理的Bean 3 获取Bean pom.xml配置 <dependency> <gro ...
- 图的BFS代码
图是严蔚敏书上P168的图, 图的邻接表存储,DFS可以看以前写的文章:http://www.cnblogs.com/youxin/archive/2012/07/28/2613362.html ]; ...
- Linux中查看进程及杀死进程命令
Linux中想杀死fcitx进程,然后再重启它. root@www.linuxidc.com:/home/zhangbin# ps -e | grep 'fcitx' 3405 ? 00 ...
- (3)选择元素——(2)文档对象模型(The Document Object Model)
One of the most powerful aspects of jQuery is its ability to make selecting elements in the DOM easy ...
- 如何使用W5300实现ADSL连接(一)
在介绍W5300连接ADSL之前,先给大家简单介绍一下WIZnet W5300这款芯片. W5300是WIZnet公司的一款单芯片器件,采用0.18μmCMOS工艺,内部集成10/100M以太网控制器 ...
- UVA 10652 Board Wrapping(凸包)
The small sawmill in Mission, British Columbia, hasdeveloped a brand new way of packaging boards for ...
- Java面试题集(1-50)
下面的内容是对网上原有的面试题集及答案进行了全面修订之后的内容(原来的题目有很多重复无用的题以及错误的答案),参照了JDK最新版本,删除了重复题目以及EJB2.x等无用内容,补充最新面试题.知识点巩固 ...