How to redirect an IP address to a machine/hostname in an Intranet?
I have a couple of intranet applications at home like an NVR server and a Plex Media Server. Each are installed in a FreeNAS jail with corresponding IP addresses like 192.168.0.2 with hostname mynvr and 192.168.0.3 with hostname myplex.
What I'm trying to achieve is when I enter http://192.168.0.2 to access the GUI of my NVR server, I want it to redirect it to http://mynvr.local or something. Reason for this is I'm trying to generate SSL using LetsEncrypt and I believe it doesn't support ip addresses.
Appreaciate any feedback.
Regards, Allen
Solution 1:
The easiest way to do that is via url rewriting at the server, which detects a bad pattern and rewrites the url to a good one, so that the users browser is redirected to the good url, away from the bad one.
That said, since your concern is about http vs https, disable web site bindings for http in your webserver, so users must use https. your server will stop listening on TCP\80.
Make sure the site uses host headers for its bindings. and consider requiring SNI, and HSTS.
Certificates secure clients from malicious web apps, not the other way around. having a certificate will not affect http traffic, so you need to disable http at the webserver (or rewrite urls, and/or use hsts to auto redirect to https). a certificate is useless without a dns server, which is why I brought it up, so you will need a dns entry for your site that has the same name the user will type into their browser. all a cert will do, is tell you if the name on the cert matches the dns name supplied in the url in the browser.
hope that helps