proxypass通过非标准端口的Apache – 这是怎么可能的192.168。*:9999的作品从计算机本身,而不是在networking上的另一台计算机?

httpd.conf的虚拟主机看起来像这样:

<VirtualHost *:9999> ServerAdmin [email protected] ServerName www.example.com ServerAlias example.com # Indexes + Directory Root. DirectoryIndex index.php DocumentRoot /var/www/html/example.com/wordpress ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:8888/ ProxyPassReverse / http://www.example.com:9999/ #ProxyPassReverseCookieDomain localhost:8888 www.example.com:9999/ ProxyPassReverseCookiePath / / </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] ServerName www.example.com ServerAlias example.com # Indexes + Directory Root. DirectoryIndex index.php DocumentRoot /var/www/html/example.com/wordpress </VirtualHost> 

运行apache的计算机(192.168.1.5)本身试图从标准的example.com服务wordpress,并将端口9999(example.com:9999)上的localhost应用程序代理到Internet。 WordPress的网站从192.168.1.5在networking上的任何地方工作,但192.168.1.5:9999上的本地主机应用代理工作在192.168.1.5本身,但不在networking内的其他计算机上。 我认为如果192.168.1.5:9999在networking上工作,它也可以在整个互联网上工作(端口转发已经在路由器上configuration),但我不明白为什么它只能在原始服务器上工作,而不是其同行。

尝试使用http://www.example.com/访问端口9999上的应用程&#x5E8F;

 <VirtualHost *:80> ServerAdmin [email protected] ServerName www.example.com ServerAlias example.com ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:9999/ ProxyPassReverse / http://localhost:9999/ ProxyPassReverseCookiePath / / </VirtualHost>