Use apache virtual host to redirect a subdomain to internal ip preserving passed port
3
votes
0
answers
2391
views
I've been looking for a while to the answer to this question and I seem to find slightly different needs from people asking questions and they get wildly different answers... but none of them seem to fit my problem.
I have a server that uses (successfully) mod_proxy to redirect subdomains of my main domain to other machines on my network, however I always need to specify the port like so
ServerName sub.domain.com
ProxyPreserveHost On
ProxyPass / http://192.168.1.123/
ProxyPassReverse / http://192.168.1.123/
What I want to accomplish is to redirect any type of connection to that subdomain AND the specified port to a different machine so something like
ServerName sub.domain.com
ProxyPreserveHost On
ProxyPass / http://192.168.1.123/
ProxyPassReverse / http://192.168.1.123/
so it would translate to
sub.domain.com:1234
=> 192.168.1.123:1234
sub.domain.com:5678
=> 192.168.1.123:5678
etc... the documentation **official documentation ** seems to suggest it is possible by passing *:* but when I do I land on my default page on my server...
Asked by TonyMorello
(351 rep)
Mar 5, 2017, 01:45 AM