Discussion:
mod_proxy proxypassreverse on Form Sumbit
Jason Sheneman
2004-02-15 19:59:20 UTC
Permalink
I have a third party application running in apache behind a firewall. I decide to install Apache on Windows 2000 to act as a proxy to the server behind the firewall. I'm having trouble getting the proxypassreverse to work for me.

I have www.server2.com/submit.php which is the server running the webapp. I have www.server1.com/app1/submit.php as where the users go. I setup my apache config to the following:

ProxyRequests off

ProxyPass /app1/ http://www.server2.com/
ProxyPassReverse / http://www.server2.com/


All seems ok at first as I have no trouble going to www.server1.com/app1/submit.php and being actually sent to www.server2.com/submit.php. Now the submit.php page is a form that has a submit button on it. The submit button does a POST to www.server2.com/Analyze. What is happening is that when I click on the submit button I see the browser trying to resolve www.server2.com/Analyze instead of www.server1.com/app1/Analyze

However I have no trouble going to www.server1.com/app/Analyze directly. It just seems that mod_proxy doesn't handle forms POSTs. Any help anyone can give me to confirm or deny my findings would be much appreciated. Also, if this should work, if anyone can give me some hints I'd be very greatful.

I've tried all kinds of combinations of proxypass and proxypassreverse, I just can't seem to get the response from the form post back no matter what I try.

Thanks...


---------------------------------
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online
Graham Leggett
2004-02-16 08:49:05 UTC
Permalink
Post by Jason Sheneman
ProxyPass /app1/ http://www.server2.com/
ProxyPassReverse / http://www.server2.com/
However I have no trouble going to www.server1.com/app/Analyze
<http://www.server1.com/app/Analyze> directly. It just seems that
mod_proxy doesn't handle forms POSTs. Any help anyone can give me to
confirm or deny my findings would be much appreciated. Also, if this
should work, if anyone can give me some hints I'd be very greatful.
mod_proxy handles form posts fine, use them all the time.

The most likely source of your problem is your URL handling. mod_proxy
does not attempt to rewrite data inside an HTML stream, and therefore it
is likely the links (in your case the destination of the submit button)
on your backend are being passed through the proxy to the browser.

A general rule of thumb that you should apply to keep yourself from
getting headaches is to maintain the same URL strategy on the backend
server as you do in your frontend URL space. In other words, it should
look like this:

ProxyPass /app1/ http://www.server2.com/app1/
ProxyPassReverse /app1/ http://www.server2.com/app1/

Regards,
Graham
--

Loading...