![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Web Programming, Web 2.0 and Mashups Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, Flash, HTML, SEO, Mashups and other Web APIs and topics. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Software/tool to route an IP packet to proxy server and capture the Proxy reply as an | Rajesh_BK | IP Networking | 0 | 02-19-2009 02:32 AM |
| reverse proxy add forward 0.6 (Default branch) | iBot | Software Releases - RSS News | 0 | 01-02-2008 04:50 AM |
| squid proxy and apache servers | marcpascual | UNIX for Advanced & Expert Users | 0 | 10-04-2005 03:26 AM |
| Apache httpd.conf <VirtualHost> issue | Spetnik | UNIX for Dummies Questions & Answers | 5 | 07-01-2003 01:35 PM |
| .forward | MsGail | UNIX for Dummies Questions & Answers | 3 | 03-08-2001 10:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Apache: Forward Proxy Via Virtualhost
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. Code:
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>
|
|
|||||
|
You should use the ProxyPass and ProxyPassReverse directives to get this working rather than the Proxy directive.
mod_proxy - Apache HTTP Server |
|
||||
|
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.
Code:
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>
Last edited by krunksta; 07-29-2009 at 11:04 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|