How to proxy a subdomain to another computer on my LAN, under OS X Server 4.1?
Visualize this outcome:
-> my single public IP -> Port forwarding 80 and 443 to LANsite1.example.com
Mac running OS X Server 4.1 on OS X 10.10 Yosemite192.168.1.10
-> my single public IP -> LANsite2.example.com
-> reverse proxy? -> :80 and :443 on LAN192.168.1.10
192.168.1.15
This is on a network where I have no option of adding another public IP.
#1 is already up and running fine.
#2 is the hard part, mainly because I'm running OS X Server (4.1, Yosemite) on #1, and the proxy setup does not seem to be the relatively straight-forward Apache one, e.g.:
<VirtualHost *:80 *:443>
ServerName site2.example.com
ProxyRequests off
ProxyPass / http://192.168.1.15/
ProxyPassReverse / http://192.168.1.15/
</VirtualHost>
That is, OS X Server has the Apache config files in odd places, and my understanding is that it likes to overwrite them with new changes made in the GUI, so I'm trying to figure out the “right” way to do this on OS X Server.
A friend of mine suggested there might be a way to do it with OS X Server's
webappctl
command and writing an appropriate webapp.plist
, though the Work with web apps section of the OS X Server docs contains almost no detail. Looking at the man
pages Apple suggests and their example .plist file, it seems to me that their idea of a “web app” really wants to be attached to a directory (i.e., site1.example.com/webapp), and not as a subdomain (as in #2, above). Perhaps I just haven't quite figured out the .plist formatting yet?What is the “right” way to do this on OS X Server?