Apache2 的反向代理不起作用
我正在使用 Apache/2.2.8 (Ubuntu) 并且遇到问题。有一个文件 /etc/apache2/sites-available/backuppc 包含以下内容:
<VirtualHost *>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /backuppc http://192.168.134.59:80/backuppc
ProxyPassReverse /backuppc http://192.168.134.59:80/backuppc
<Location /backuppc/>
ProxyPassReverse /backuppc
</Location>
</VirtualHost>
This running on 192.168.134.10。在浏览器 (FF) 中,地址 http://localhost/BackupPc 会转到所需的服务器,但地址行显示为 http://192.168.134.59/backuppc/。 感觉这个 ProxyPass 就像 DNS 服务器一样工作...... 最后,从互联网上只能访问 192.168.134.10,通过 /backuppc 我可以登录,但现在可以访问所需的服务器。
请帮忙,谢谢。
和平
冰
I'm using Apache/2.2.8 (Ubuntu) and have a problem. There is a file /etc/apache2/sites-available/backuppc with the following:
<VirtualHost *>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /backuppc http://192.168.134.59:80/backuppc
ProxyPassReverse /backuppc http://192.168.134.59:80/backuppc
<Location /backuppc/>
ProxyPassReverse /backuppc
</Location>
</VirtualHost>
This runs on 192.168.134.10. In the browser (FF) the address http : //localhost/BackupPc goes to the desired server but the addressline shows up with http : //192.168.134.59/backuppc/.
This feels like this ProxyPass works like a DNS-Server...
Finally from internet only 192.168.134.10 is reachable, and with /backuppc i get the login but now access to the desired server.
Please help, THX.
Peace
Ice
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 http://wiki.apache.org/cocoon/ApacheModProxy< 的帮助下自己得到了它/a>
缺少的部分是ProxyPreserveHost On,正如您在我的配置中看到的那样:
这种情况发生在为 wiki 提供服务的 ip 192.168.134.10 后面的 apache 上。防火墙具有到该服务器的端口转发。现在,此配置允许我们访问备份服务器的网站,而无需更改防火墙。
不过还是谢谢
和平
冰的回复
i got it by myself with the little help of http://wiki.apache.org/cocoon/ApacheModProxy
The missing piece was the ProxyPreserveHost On as you can see in my configuration:
This happens on apache behind the ip 192.168.134.10 who is serving a wiki. The firewall has a portforwarding to this server. This configuration now allow's access to the website of the backup-server with out change on the firewall.
However, thanks for your replies
Peace
Ice