I've set up a forward proxy within a VirtualHost (see below) on Apache 2.2.11. I then browse using mydomain.com:80 as the proxy - I've also tried using the IP address of the VirtualHost xxx.xxx.xxx.xxx:80. It works fine, the only problem is that in both cases the server's main IP address is always displayed at the other end. Is there a way to make it so that the individual IP of the VirtualHost is shown instead?
I've tested the proxy via other VirtualHosts on the server and it doesn't work, so I know that it's being properly channelled through this one.
NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80>
ServerName mydomain.com
DocumentRoot /xxx/xxx/public_html
ServerAdmin xxx@xxx.com
ProxyRequests On
ProxyVia On
<Proxy *>
Order deny,allow
Allow from xxx.xxx.xxx.xxx
</Proxy>
</VirtualHost>
Thanks for the reply, I tried your suggestion (see below). This produces a mirror of the external site (at http://mysite.com/mirror/\), but the main IP of the server (instead of the VirtualHost IP) is still showing at the other end - I'm talking about the REMOTE_ADDR environment variable. I want it to be the individual IP address of the VirtualHost instead of the server's main/global IP.
NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80> # I want this IP address to show as the REMOTE_ADDR
ServerName mydomain.com
DocumentRoot /xxx/xxx/public_html
ServerAdmin xxx@xxx.com
ProxyPass /mirror/ http://externalsite.com/
ProxyPassReverse /mirror/ http://externalsite.com/
<Proxy *>
Order deny,allow
Allow from xxx.xxx.xxx.xxx
</Proxy>
</VirtualHost>