Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Our home setup consists of two Linux webservers on a single static IP. My server currently uses the standard HTTP(S) ports. My friend's server uses non-standard ports to get around this. Both of us have URLs set up.
I'm curious as to whether I could configure Apache on my server to redirect or proxy any connections heading to my friend's URL (on standard ports), to his server, transparently. I know I could rewrite the URLs but I'm not good with the rules, so I'm wondering if I could use mod_proxy to send the connection to the other machine through my server. I've done something similar, but that involved proxying all incoming connections.
Is it possible? Thanks, and sorry if this has been answered; I wasn't sure what to search for.

share|improve this question

You could also do this using virtual hosts and setup Apache as a reverse proxy. This is how I have it setup where I work. -> ProxyPass -> ProxyPass

Checkout the documentation for ProxyPass and ProxyPassReverse.

If you just do a name based virtual host for both then you could add something like this to your virtual host definition (or replace localhost for your IP if your box will be hosting apache):

<Location />

Then in your friend's virtual host config

<Location />

You can also add ports to the ProxyPass directive if you don't want your friend to change firewall rules, service setting etc. Or you can even be a reverse proxy for another external IP address too.

share|improve this answer

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.