小编DrK*_*liN的帖子

Apache 在一个 VirtualHost 中有多个 ProxyPass 条目

所以我有以下两种配置:

一方面是后端服务器:

<VirtualHost *:80>
  ProxyPreserveHost On
  ServerName localhost
  ProxyPass /backend http://some_remote_ip:7000/backend
  ProxyPassReverse /backend http://some_remote_ip:7000/backend
  ProxyPassReverseCookiePath / /backend
  ProxyPassReverseCookieDomain some_remote_ip localhost
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

另一方面是前端服务器:

<VirtualHost *:80>
  ProxyPreserveHost On
  ServerName localhost
  ProxyPass  /excluded !
  ProxyPass / http://127.0.0.1:9000/
  ProxyPassReverse / http://127.0.0.1:9000/
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

如果我将它们放在一个.conf文件中,则只有文件中第一个写入的文件才能工作,因此从技术上讲,它们都是正确的。

所以我的问题是如何在同一配置中有多个ProxyPass条目? VirtualHost

PS:我需要能够访问

  • 后端在 localhost/backend
  • 前端在 localhost

apache-http-server proxy

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

标签 统计

apache-http-server ×1

proxy ×1