Hi George -

> I want to do a reverse proxy of an external site using Apache:
> 
> <VirtualHost prague>
> ProxyRequests on

You will want to set "ProxyRequests off" for a reverse proxy, otherwise
someone could use you as a forward proxy to get to someplace else.


> ProxyPass / http://www.externalsite.com
> ProxyPassReverse / http://www.externalsite.com

Not sure if it matters, but might need a trailing slash on those, i.e.:
  ProxyPass        / http://www.externalsite.com/
  ProxyPassReverse / http://www.externalsite.com/


> ServerName prague
> </VirtualHost>
> 
> This works fine AFICT except if there is a page on the remote site
> that has a form or other link that uses POST.

Have you looked at the URL specified in the form ACTION to see if it is an
absolute URL?  For example, suppose I point my browser at
http://www.george.com/showform.html.  Your proxy then sends me the content
of http://www.externalsite.com/showform.html.  If the form on that page
POSTs to "http://www.externalsite.com/cgi-bin/form.cgi"; (instead of
"/cgi-bin/form.cgi"), then when I submit I will go directly to
www.externalsite.com and bypass your proxy.  The same would be true of any
URL in the site that is specified absolute rather then relative.


> The maybe off-topic question is: Is this documented anywhere? I
> haven't been able to find a good explanation why this is. Is there a
> workaround?

You would need to rewrite any URLs in the page before you send it to the
browser, to either turn them into relative URLs, or to point them to
www.george.com instead of www.externalsite.com.  I'm pretty sure you can't
do that with mod_proxy or mod_rewrite alone (although I have seen people
do some crazy stuff with mod_rerwite).


> I should note that I am using mod_proxy rather than mod_rewrite
> because it is my (possibly incorrect) understanding that requests
> proxied via mod_rewrite will not end up in my local logs.

I have not found that to be the case.


Larry Leszczynski
[EMAIL PROTECTED]


Reply via email to