具有代理身份验证的Apache反向代理

时间:2011-09-21 15:37:56

标签: apache proxy reverse-proxy mod-proxy proxy-authentication

我有以下设置

方框A(192.168.8.180 - 运行apache反向代理)

方框B(192.168.8.100:808 - 连接到互联网的代理服务器)

由于内部原因,方框A的IP被重定向到http://xyz.mydomain.com/。反向代理使用Box B中运行的代理连接到Internet。

当代理不需要任何身份验证时,设置正常。但是当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

代理凭据是正确的。用浏览器验证。

由于

0 个答案:

没有答案