So you want to have different web servers on your home network that are exposed to the outside world? How do you do that? Most web servers listen on port 80 for non-ssl and port 443 for ssl.
Say your home network is setup like this:
1. Setup a dynamic dns service.
Go to duckdns.org (super simple) to create a subdomain url for each computer you’d like to access in your internal network from any computer in the world. I won’t explain it here as the duckdns site does a good job. In my example you would need to setup 3 subdomains for your home network, I’ll use the following:
2. Setup Port Forwarding
Normally, if you are outside your home network, say at a coffee shop, and plug “http://homey.duckdns.org” in your browser you most likely will end up either with blank page/unauthorized page or will get the control panel login for your router which is at 192.168.1.1.
To setup port forwarding within your home network go into your router (192.168.1.1 in my example) and navigate to the port forwarding section. I use ddwrt so in my home network I would point my browser to NAT/QoS and set the port forwarding as follows:
|Port From (incoming set by url, e.g.: http://blog.duckdns.org:202)||Ip Address||Port To (This is port server is listening on)|
|80||192.168.1.1||804 (fake port, nothing is listening here)|
Here’s a screen shot of my example setup:
If someone leaves the port out (http://blog.duckdns.org) it would just go to a blank page because it would be forewarded to 192.168.1.1:804 which is a fake port with nothing listening.
Also, if you’re using ssl you’ll need to set up ssl certificates (use letsencrypt for free ssl certifices)
As a final note, if could have all of these sites on one computer (personally I’m doing this on raspberry pi 3 using lighttpd and homeassistent), but you would have to change the default ports for each server; e.g., instead of your blog listening to 443, you would have the ssl port listen to say 452. , your wife’s ssl port listening to say 574, etc. .