haproxy /admin跳转 不会在接口上再次加上admin

http://www.xx.com/admin/api/menu


[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 wx3" );
};
				   


  app->start;



访问:
http://120.xx.118.6:3000/admin/api/menu



http://www.xx.com/admin/api/menu


haproxy 上配置;


acl             admin_req           path_beg                -i                      /admin
use_backend     admin_80           if                      admin_req

backend admin_80
        mode            http
        balance         roundrobin
        server          apphost01_8083          120.xx.118.6:3000  check inter 2000 fall 3


你可能感兴趣的:(haproxy /admin跳转 不会在接口上再次加上admin)