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

There is an existing application hosted on Apache. I want to send some urls(Post Forms) to another server(not apache - just a program) for some preprocessing. This is how this is organized

1) I have added an additional listen port on Apache conf (say 1234)

2)Added a Reverse Proxy on port 80 to send some urls to the 2nd server listening on it's own port

3) Since the actual html is hosted on apache, the 2nd server requests the required page from Apache on port 1234. It then modifies the html(post form) and serves it. It takes the posted data again modifies it & sends it back to apache.

I am able to achieve the above with the following steps 1) In my existing htdocs directory structure - I create 2 new subdirectories called dir1 and dir2

2) All forms which need to be preprocessed, I move to directory dir1. All the scripts which process the post data, I move to dir2. I change other htmls to update the paths.

3) I add the following Proxy confs

ProxyPass /dir1 http://localhost:1234/dir1

ProxyPassReverse /dir1 http://localhost:1234/dir1

Similiarly for dir2 also.

This is working fine, but I was wondering if these is a better way to do this. The main improvement I am looking for is to do the reverse proxy configuration in such a way that I do not have disturb the original app hosted in htdocs (by moving stuff to dir1, dir2 - updating references etc). Is there a way to do this?

share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.