zoukankan      html  css  js  c++  java
  • 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开头的都转发到  相应的机器
      
      
      
      
      
      
      
      
      
      
      
      

  • 相关阅读:
    SOGo 2.0 发布,群组协同工作系统
    微软随.NET 4.5发布新REST API框架
    DynamicReports 3.0.2 发布,Java 报表方案
    使用 Ant 集成 IBM Security AppScan Standard 进行自动测试
    SUSE 用 zypper 工具 安装 rpm
    嵌入式ARM系统中OpenCV的移植
    qtopiax86安装配置及编程方法
    [转]QTCreator的使用
    在Qt Creator中使用OpenCV库
    vim
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6200062.html
Copyright © 2011-2022 走看看