Apache2 的反向代理不起作用

发布于 2024-08-08 14:02:08 字数 704 浏览 6 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最舍不得你 2024-08-15 14:02:08

我在 http://wiki.apache.org/cocoon/ApacheModProxy< 的帮助下自己得到了它/a>

缺少的部分是ProxyPreserveHost On,正如您在我的配置中看到的那样:

<VirtualHost *>

    ProxyPreserveHost On
        ProxyRequests Off

        <Proxy *>
                Order deny,allow
              Allow from all
        </Proxy>

        ProxyPass /backuppc http://192.168.134.59/backuppc
        ProxyPassReverse /backuppc http://192.168.134.59/backuppc


</VirtualHost>

这种情况发生在为 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:

<VirtualHost *>

    ProxyPreserveHost On
        ProxyRequests Off

        <Proxy *>
                Order deny,allow
              Allow from all
        </Proxy>

        ProxyPass /backuppc http://192.168.134.59/backuppc
        ProxyPassReverse /backuppc http://192.168.134.59/backuppc


</VirtualHost>

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文