My clients sends requests to http://localhost:80/test/string. However my processing unit is at http://localhost:9080/servlet/Endpoint?req=test.

I want this redirection to take place transparently of the client. My client should take the response from http://localhost:9080/servlet/Endpoint?req=test still believing that the response came from http://localhost:80/test/string.

How can be done? Is it possible to do it using a proxy server?

link|improve this question

0% accept rate
1  
Maybe this should be moved to serverfault.com or unix.stackexchange.com ? – thejh Nov 7 '10 at 12:37
What you need is a reverse-proxy, not a redirect. – sybreon Nov 8 '10 at 3:13
feedback

migrated from stackoverflow.com Nov 8 '10 at 0:14

This question came from our site for professional and enthusiast programmers.

1 Answer

An other solution is that you setup a reverse proxy with apache with proxy_http module (included by default):

the config file should be something like:

ProxyRequests off
ProxyPass / http://localhost:9080/
ProxyPassReverse / http://localhost:9080/

Then play with mod_rewrite.

link|improve this answer
ProxyPass does not work with the Question Mark character. Please bare in mind that the URL is changing not only the port – cateof Nov 7 '10 at 12:45
I was about to apology, but I've just checked on one of my website where I use a reverse proxy for redmine (I run a standalone redmine server on port 3000). The search works perfectly with myreverse.com/search?q=projectname – aif Nov 7 '10 at 12:51
I assume that you are using you string as a pattern and not as a substitution string. I am using ProxyPass pattern subs?q=test and the tomcat returns that %3Fq=test is not found (? is encoded as %3F) – cateof Nov 7 '10 at 13:07
I'm not sure I understand what you mean. The ?q is used as a GET argument for the search form, and it works fine. – aif Nov 7 '10 at 16:04
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.