I'm running some webcams (with embedded servers) on my business network that are accessible via the web, and I want to make "pretty" URLs that Apache can route to the ports that they run on so my wife doesn't need to memorize the port numbers.
For example, one of the cameras is local IP 192.168.0.200, and the webcam server (I'm using IP Webcam on an Android phone) is running on port 7890. I port forwarded my router and I can access it via the web at mydomain.com:7890. What I want to do is give it a nice URL like
mydomain.com/cam/1 and have Apache route to the correct LAN IP/port. This also works fine with the following in my
ProxyPass /cams/1 http://192.168.0.200:7890 ProxyPassReverse /cams/1 http://192.168.0.200:7890
I can type
mydomain.com/cam/1 into the browser and get the html page that it serves.
The problem is, the page it initially serves is just a bunch of links, i.e., the following:
where each link is relative to the root of the page. For example, I usually use the 3rd link, "Use java browser plugin". The URL for this link is
/java.html. If I use the "absolute" URL,
mydomain.com:7890/java.html, it works as expected. But with the Proxying enabled, the link produced is
mydomin.com/java.html, and I have no java.html in my root folder (even if I did, it would be a different file than the webcam's).
So my question is, how to I continue to have these pretty URLs, but then have the URLs internal to the served page (or any arbitrary sub-URLs) still respect the
/cams/1 offset so that it will all work right?