所以我有以下两种配置:
一方面是后端服务器:
<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/backendlocalhost