You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Brian Hill <ja...@yahoo.com> on 2006/08/16 16:34:47 UTC

[users@httpd] Reverse Proxy - HTTP Response Header and Query String Params

Hi,

How can I use a reverse proxy to modify a query string parameter in an HTTP response header coming from my backend server?

I'm setting up Apache 2.2 as a reverse proxy in front of a 3rd party app.  I have just about everything working except for the following.  If I hit the URL:

http://myreverseproxy.server.com/some_path/some_page?query_string_params

... the reverse proxy passes this on to the backend server, which generates a response header with a location like:

http://3rdparty.server.com/another_path/another_page?p_submit=http%3A%2F%2F3rdparty.server.com%2Fyetanotherpath

Using ProxyPassReverse, I can change the first bit of the URI as needed, but how can I rewrite the query string parameter p_submit (from "3rdparty.server.com" to "myreverseproxy.server.com"?  Will ProxyPassReverse allow me to alter parameters?  Or, should I be using mod_rewrite (RewriteRule)?

Any guidance is appreciated.

Thanks,
Brian

 			
---------------------------------
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail Beta.

Re: [users@httpd] Reverse Proxy - HTTP Response Header and Query String Params

Posted by Joshua Slive <jo...@slive.ca>.
On 8/16/06, Brian Hill <ja...@yahoo.com> wrote:
> Hi,
>
> How can I use a reverse proxy to modify a query string parameter in an HTTP
> response header coming from my backend server?
>
> I'm setting up Apache 2.2 as a reverse proxy in front of a 3rd party app.  I
> have just about everything working except for the following.  If I hit the
> URL:
>
> http://myreverseproxy.server.com/some_path/some_page?query_string_params
>
> ... the reverse proxy passes this on to the backend server, which generates
> a response header with a location like:
>
> http://3rdparty.server.com/another_path/another_page?p_submit=http%3A%2F%2F3rdparty.server.com%2Fyetanotherpath
>
> Using ProxyPassReverse, I can change the first bit of the URI as needed, but
> how can I rewrite the query string parameter p_submit (from
> "3rdparty.server.com" to "myreverseproxy.server.com"?  Will ProxyPassReverse
> allow me to alter parameters?  Or, should I be using mod_rewrite
> (RewriteRule)?

As far as I know, there is no existing feature or module that can do this.

I'm not sure why it is really necessary, however.  Given that
ProxyPassReverse directs the request back to your reverse proxy, you
can monkey with the query string when you get the request back
(probably with mod_rewrite).

So, no, there is no way to make arbitrary changes to response headers,
but mod_rewrite can certainly handle this when it comes back as a new
request.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org