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开头的都转发到  相应的机器
  
  
  
  
  
  
  
  
  
  
  
  

原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6200062.html