Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Nov 8 '10 at 0:14

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

What you need is a reverse-proxy, not a redirect. – sybreon Nov 8 '10 at 3:13

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.

share|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 – 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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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