logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Rewriting URLs before they are returned to client - How?
Author
russch



Joined: 24 Apr 2013
Posts: 2
Location: Charlotte, NC

PostPosted: Wed 24 Apr '13 18:56    Post subject: Rewriting URLs before they are returned to client - How? Reply with quote

Hi There!

Apache newb here.

I need to accomplish the following:

1. User hits my new 2.4 reverse proxy at http://somebox.com

2. I proxy the request through to my "real" app server at http://therealserver.com

3. I also use a re-write rule to add a querystring to the URL: ?Parameter=Foo

4. So, client's request arrives at the my app server as http://therealserver?Parameter=Foo

5. When my app server responds, it is including the Parameter=Foo key/value combination. I don't want this.

6. I want my reverse proxy (somebox.com) to strip "Parameter=Foo" from the string which gets returned to the client.

I have steps 1 & 2 working nicely, but it looks like I can't handle the last bit with with mod_rewrite. I found mod_filter and mod_substitute, but it appears that this stuff is used for re-writing strings IN the document. Can these libs be used to maybe modify (I'm guessing here) the headers so that the "?Parameter=Foo" string can't be seen on the client if they're running something like fiddler?

Thanks!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7405
Location: EU, Germany, Next to Hamburg

PostPosted: Thu 25 Apr '13 15:17    Post subject: Reply with quote

How should the URL look like for the user on somebox.com ? somebox.com/parameter/bar ? Or something else?
Back to top
russch



Joined: 24 Apr 2013
Posts: 2
Location: Charlotte, NC

PostPosted: Thu 25 Apr '13 21:36    Post subject: Reply with quote

The user lands on the reverse proxy and sees:

http://somebox.com

....The proxy executes a re-write rule to append "?Parameter=Foo", and passes this through to http://therealserver.com:

http://therealserver.com?Parameter=Foo

...the reverse proxy now needs to strip the same string it appended to the URL, so that the client on somebox.com only sees:

http://somebox.com

...however, the "work" done by ?Parameter=Foo will display in the output.

Essentially, I'm trying to "hide" the parameter from curious user who then might try to experiment with putting values on the URL themselves.

Thanks![/b]
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7405
Location: EU, Germany, Next to Hamburg

PostPosted: Thu 25 Apr '13 23:23    Post subject: Reply with quote

OK, but how should the proxy server know which parameter it shall pass or is it always the same?
Back to top


Reply to topic   Topic: Rewriting URLs before they are returned to client - How? View previous topic :: View next topic
Post new topic   Forum Index -> Apache