试图找到一种基于传入标头实现代理传递的方法。
例如:
proxyPass / https://%{{x-backend-host}}/
X-backend-host 将在请求标头中的位置。
这背后的想法是拥有多个传入域,即 one.example.com、two.example.com、three.example.com 并让它们指向自己独特的后端。
有没有人有任何想法或参考,我可以看看实现这样的场景。
试图找到一种基于传入标头实现代理传递的方法。
例如:
proxyPass / https://%{{x-backend-host}}/
X-backend-host 将在请求标头中的位置。
这背后的想法是拥有多个传入域,即 one.example.com、two.example.com、three.example.com 并让它们指向自己独特的后端。
有没有人有任何想法或参考,我可以看看实现这样的场景。
您需要通过 mod_rewrite 的重写规则来执行此操作。来自 ProxyPass 的文档:
If you require a more flexible reverse-proxy configuration, see the RewriteRule directive with the [P] flag.
阅读有关 RewriteRule 的信息: https ://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#rewriterule (向下滚动描述不同标志的位置并查找 [P] 标志)