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.
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.
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):
Then in your friend's virtual host config
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.