我需要一个快速的解决scheme,允许我在防火墙后面托pipe多个Web服务器。 他们在不同的计算机上,所以我不能使用Apache虚拟主机。 我也不想为每台机器使用不同的非标准端口。
问题是我的路由器只能将端口443转发给一台机器。 我认为最好的解决scheme是使用反向代理或代理转发,但是我一直在理解如何设置这个问题。
build立:
我试图把以下放在server1上的/etc/apache2/conf-available/proxy-pass.conf中:
SSLProxyEngine on ProxyPass "/directory" "https://server2.domain.com/directory" ProxyPass "/owncloud" "https://server3.domain.com/owncloud"
这工作,但不是我在找什么。
无论目录如何,我都需要将所有stream量引导到由传入URL域名指定的服务器,因为我在基本URL之后有很多子目录。
就像是:
ProxyPass "https://server2.domain.com" "https://server2.domain.com" ProxyPass "https://server3.domain.com" "https://server3.domain.com"
我应该寻找另一种解决scheme,如pound ,还是有办法用apache来做到这一点。 我想我已经安装了Apache,所以使用它?
他们在不同的计算机上,所以我不能使用Apache虚拟主机
其实这正是你需要做的;)
本手册对此没有明确的说明,但是通过将/ ,根URL,ProxyPass指令的目标作为虚拟主机条目,可以反向代理特定主机的所有内容:
<VirtualHost *:80> ServerName host.example.com ProxyPass / http://internalserver.example.net/ ProxyPassReverse / http://internalserver.example.net/ </VirtualHost> <VirtualHost *:80> ServerName host2.example.com ProxyPass / http://other-internalserver.example.net/ ProxyPassReverse / http://other-internalserver.example.net/ </VirtualHost>