HAProxy:带有子目录/子路径/子文件夹的后端? [英] HAProxy: Backend with subdirectory / subpath / subfolder?

查看:320
本文介绍了HAProxy:带有子目录/子路径/子文件夹的后端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力实现这一目标:

I am trying to achieve this:

http://front-end       --> http://back-end/app-1
http://front-end/app-2 --> http://back-end/app-2-another-path

这样,请求将以这种方式处理:

So that requests will be handled this way:

http://front-end/do-this       --> http://back-end/app-1/do-this
http://front-end/app-2/do-that --> http://back-end/app-2-another-path/do-that

我该怎么做?谢谢.

推荐答案

您可以通过以下配置来实现"http://front-end/app-2/do-that --> http://back-end/app-2-another-path/do-that":

You can achieve this "http://front-end/app-2/do-that --> http://back-end/app-2-another-path/do-that" with the following configuration:

frontend http   
   #match url ending with /xxxxx/do-that
   acl do-that path_end -i /app-2/do-that

   use_backend server1 if do-that

backend server1
   reqirep ^([^\ :]*)\ /app-2/(.*)     \1\ /app-2-another-path/\2
   server server 168.192.X.X

此处是有关的详细信息reqirep .

这篇关于HAProxy:带有子目录/子路径/子文件夹的后端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆