Apache 具有代理身份验证的反向代理
我有以下设置
Box A (192.168.8.180 - 运行 apache 反向代理)
Box B (192.168.8.100:808 - 连接到互联网的代理服务器)
由于内部原因,Box A 的 IP 被重定向到 http://xyz.mydomain.com/。反向代理使用 Box B 中运行的代理来连接到互联网。
当代理不需要任何身份验证时,该设置工作正常。但是当 Box B 的代理需要身份验证时,我对反向代理的所有请求都会失败,并出现以下错误。
<h1>Unauthorized ...</h1>
<h2>IP Address: 192.168.8.180:1799<br>
MAC Address: <br>
Server Time: 2011-09-21 20:32:16<br>
Auth Result: </h2>
这是我的 apache 配置
<VirtualHost *:80>
ServerName xyz.mydomain.com
ProxyRequests Off
ProxyPreserveHost Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyRemote * http://192.168.8.100:808/
ProxyPass / http://xyz.mydomain.com/
ProxyPassReverse / http://xyz.mydomain.com/
RequestHeader set Authorization "Basic cGFuZGlhbjpwYW5kaWFu"
<Location />
Order allow,deny
Allow from all
</Location>
ErrorLog "logs/myerror.log"
CustomLog "logs/myaccess.log" common
</VirtualHost>
有什么想法吗?
访问日志显示以下
127.0.0.1 - - [21/Sep/2011:20:24:55 +0530] "GET / HTTP/1.1" 407 142
127.0.0.1 - - [21/Sep/2011:20:24:57 +0530] "GET / HTTP/1.1" 407 142
192.168.8.180 - - [21/Sep/2011:20:25:33 +0530] "GET / HTTP/1.1" 407 142
192.168.8.227 - - [21/Sep/2011:20:32:07 +0530] "GET / HTTP/1.1" 407 142
192.168.8.180 - - [21/Sep/2011:20:32:14 +0530] "GET / HTTP/1.1" 407 142
192.168.8.180 - - [21/Sep/2011:20:32:15 +0530] "GET / HTTP/1.1" 407 142
192.168.8.227 - - [21/Sep/2011:20:33:58 +0530] "GET / HTTP/1.1" 407 142
192.168.8.227 - - [21/Sep/2011:20:35:03 +0530] "GET / HTTP/1.1" 407 142
192.168.8.227 - - [21/Sep/2011:20:35:16 +0530] "GET / HTTP/1.1" 407 142
192.168.8.227 - - [21/Sep/2011:20:35:24 +0530] "GET / HTTP/1.1" 407 142
内容代理凭据正确。用浏览器验证。
谢谢
I have the following setup
Box A (192.168.8.180 - running apache reverse proxy)
Box B (192.168.8.100:808 - Proxy server to connect to internet)
Due to internal reasons, The IP of box A is redirected to http://xyz.mydomain.com/. The reverse proxy uses the proxy running in Box B to connect to internet.
The setup works fine when the proxy does not need any authentication. But When the proxy at Box B needs authentication, all my request to the reverse proxy fails with the following error.
<h1>Unauthorized ...</h1>
<h2>IP Address: 192.168.8.180:1799<br>
MAC Address: <br>
Server Time: 2011-09-21 20:32:16<br>
Auth Result: </h2>
Here is my apache configuration
<VirtualHost *:80>
ServerName xyz.mydomain.com
ProxyRequests Off
ProxyPreserveHost Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyRemote * http://192.168.8.100:808/
ProxyPass / http://xyz.mydomain.com/
ProxyPassReverse / http://xyz.mydomain.com/
RequestHeader set Authorization "Basic cGFuZGlhbjpwYW5kaWFu"
<Location />
Order allow,deny
Allow from all
</Location>
ErrorLog "logs/myerror.log"
CustomLog "logs/myaccess.log" common
</VirtualHost>
Any ideas?
access log says the following
127.0.0.1 - - [21/Sep/2011:20:24:55 +0530] "GET / HTTP/1.1" 407 142
127.0.0.1 - - [21/Sep/2011:20:24:57 +0530] "GET / HTTP/1.1" 407 142
192.168.8.180 - - [21/Sep/2011:20:25:33 +0530] "GET / HTTP/1.1" 407 142
192.168.8.227 - - [21/Sep/2011:20:32:07 +0530] "GET / HTTP/1.1" 407 142
192.168.8.180 - - [21/Sep/2011:20:32:14 +0530] "GET / HTTP/1.1" 407 142
192.168.8.180 - - [21/Sep/2011:20:32:15 +0530] "GET / HTTP/1.1" 407 142
192.168.8.227 - - [21/Sep/2011:20:33:58 +0530] "GET / HTTP/1.1" 407 142
192.168.8.227 - - [21/Sep/2011:20:35:03 +0530] "GET / HTTP/1.1" 407 142
192.168.8.227 - - [21/Sep/2011:20:35:16 +0530] "GET / HTTP/1.1" 407 142
192.168.8.227 - - [21/Sep/2011:20:35:24 +0530] "GET / HTTP/1.1" 407 142
The proxy credentials are correct. verified with browser.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论