相关疑难解决方法(0)

ProxyPassMatch与ProxyPassReverse

伙计们,我们正在尝试为以下场景设置Apache反向代理:

  • 传入请求采用表单 http://foo.com/APP/v1/main.html
  • 对于某些服务器,URL将引用差异版本,例如, http://foo.com/APP/v2/main.html
  • 上游负载均衡器(HAProxy)将请求发送到正确的服务器,该服务器将具有面向JBoss服务器的Apache2反向代理.
  • 当请求出现在Apache 2时,它将具有请求路径 /APP/v1/main.html
  • 我们希望它(反向)代理出去http://localhost:8080/AppContext/main.html,不论在URL版本片段(V1,V2等).

我一直试图这样做:

ProxyPassMatch ^/.*?/APP.*?/(.*)$ http://localhost:8080/AppContext/$1
ProxyPassReverse /APP http://localhost:8080/AppContext
Run Code Online (Sandbox Code Playgroud)

我的问题是:

  1. 我使用ProxyPassMatch正确吗?
  2. ProxyPassReverse是"静态的".如何让它意识到之后可能变化的东西/APP

感谢您的任何见解.

-Raj

apache reverse-proxy proxypass

16
推荐指数
1
解决办法
4万
查看次数

标签 统计

apache ×1

proxypass ×1

reverse-proxy ×1