title: Apache Reverse proxy with proxy authentication
body: <p>I have the following setup</p>
  
  <p>Box A (192.168.8.180 - running apache reverse proxy)</p>
  
  <p>Box B (192.168.8.100:808 - Proxy server to connect to internet)</p>
  
  <p>Due to internal reasons, The IP of box A is redirected to <a href="http://xyz.mydomain.com/">http://xyz.mydomain.com/</a>. The reverse proxy uses the proxy running in Box B to connect to internet.</p>
  
  <p><strong>The setup works fine when the proxy does not need any authentication</strong>. But When the proxy at Box B needs authentication, all my request to the reverse proxy fails with the following error.</p>
  
  <pre><code>&lt;h1&gt;Unauthorized ...&lt;/h1&gt;
  &lt;h2&gt;IP Address: 192.168.8.180:1799&lt;br&gt;
  MAC Address: &lt;br&gt;
  Server Time: 2011-09-21 20:32:16&lt;br&gt;
  Auth Result: &lt;/h2&gt;
  </code></pre>
  
  <p>Here is my apache configuration</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName xyz.mydomain.com
      ProxyRequests Off
      ProxyPreserveHost Off
      &lt;Proxy *&gt;
          Order deny,allow
          Allow from all
      &lt;/Proxy&gt;
  
      ProxyRemote * http://192.168.8.100:808/
      ProxyPass / http://xyz.mydomain.com/
      ProxyPassReverse / http://xyz.mydomain.com/
      RequestHeader set Authorization "Basic cGFuZGlhbjpwYW5kaWFu"
  
  
      &lt;Location /&gt;
          Order allow,deny
          Allow from all
      &lt;/Location&gt;
  
      ErrorLog "logs/myerror.log"
      CustomLog "logs/myaccess.log" common
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>access log says the following</p>
  
  <pre><code>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
  </code></pre>
  
  <p>The proxy credentials are correct. verified with browser.</p>
  
  <p>Thanks</p>