Accessing Lab Servers from Internet with subdomains on dynamic WAN ip

How can I access my lab servers from the internet using subdomains such as lab1.mydomain.com, lab2.mydomain.com, lab3.mydomain.com. My setup is as follows.
I have google domains:
i did setup DDNS to mydomain.com.
then i did setup my lab1,lab2,lb3 CNAMES. however all of them point to my 1 WAN IP.

You can use a reverse proxy such as Nginx of Haproxy in Pfsense however I would recommend setting up OpenVpn instead one port and very secure + you can then use internal DNS to resolve your Servers.

2 Likes

I use this for my reverse proxy manager https://nginxproxymanager.jc21.com/ its so easy and has Let’s Encrypt built in.

1 Like

I use Caddy, It is super easy to use and HTTPS is handled automatically. I am thinking of moving to Traefik though because most of my apps are running in Docker.

1 Like

The easy (yet horrible) way to do it is you have example.com set to DDNS. Then use different ports for the services and portforward that.

The better way. Is to set a reverse proxy and have that point to each server, so when you go to lab1.example.com It knows you want to the server lab1.

The best way is to VPN, not always acceptable, e.g. gets blocked on filters.

1 Like

Since you just wrote about “accessing” the servers, be aware that a (HTTP) reverse proxy will of course only allow you to access web servers in your local network from the internet. You still won’t be able to connect via SSH, for example.

1 Like

Thank you all. Currently I’m using OpenVPN on pfsense. Works great.
Anybody has any experience setting reverse proxy on Synology NAS web station. ?
I’m trying to configure it that way with no luck.

https://nginxproxymanager.jc21.com/ Actually support streams so you can use it for SSH and the like. Works great I use it all the time.