1

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.

1 Answer 1

1

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.

a.domain.com -> ProxyPass http://192.168.1.101
b.domain.com -> ProxyPass http://192.168.1.102

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 />
    ProxyPass http://192.168.1.101
    ProxyPassReverse http://192.168.1.101
</Location>

Then in your friend's virtual host config

<Location />
    ProxyPass http://192.168.1.102
    ProxyPassReverse http://192.168.1.102
</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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .