【发布时间】:2018-09-23 22:28:54
【问题描述】:
我想将多个面向客户的 URL 映射到单个内部端点,但使用查询参数来识别每个客户。
例如客户输入https://external_host/customer1
我想要一个反向代理将其转发为https://internal_host/app?customer=cust1
我尝试了以下方法:
<Location "/customer1" >
RewriteEngine On
RewriteRule /customer1 /customer1?customer=cust1 [QSA,P]
ProxyPass https://<internal host>/app
ProxyPassreverse https://<internal host>/app
</Location>
<Location "/customer2" >
RewriteEngine On
RewriteRule /customer2 /customer2?customer=cust2 [QSA,P]
ProxyPass https://<internal host>/app
ProxyPassreverse https://<internal host>/app
</Location>
基本代理工作,请求被转发到内部服务器,但不添加查询参数。
从我所做的所有阅读中,我觉得应该可以做我想做的事,但不能让它发挥作用。
感谢您的指点。
问候 克里斯
【问题讨论】:
标签: apache mod-proxy query-parameters proxypass