Moving from DuckDNS to own domain with several services, need help

I have a “NUC” today with HassOS, but it’s exposed through DuckDNS. I also have my very own separate domain with a simple and static HTML/CSS/JS website on it, very lightweight. It’s just me and a few friends who use it. DuckDNS has been blocked at my workplace, so I want to move away from it, and to me, it sounds like a good idea to host the website myself on the same “NUC” as I use for HA. I’ve found this addon, Apache2, and I think(don’t know for sure) that it should be able to run my simple website.

My home IP address is a lease, so I need to update it automatically, and I guess using the Hass.io Addon Dynamic IP Updater for Cloudflare or the Cloudflare Integration (What’s the difference?) should take care of that. If I understand correctly, It will keep the A-record up to date, which will make sure that mysite.com always points to the correct public IP address for my home network. The tricky part for me is how to route these connections and make them all work. I want to use www.mysite.com for my website, hass.mysite.com for HA, plex.mysite.com for Plex etc. That would be creating the CNAME’s www, hass, plex etc, correct? Optionally, I can use subdomains such as www.mysite.com/hass, that’s totally fine if it’s the easier way.

How/where do I route those connections to my server at home? Somewhere, I need to setup ports, like 8123 for HA, 443 for my website etc. Is that done at Cloudflare, in my router and/or at my server? Do they all use the same certificate for SSL? Do I need a reverse proxy addon as well? Or anything else I need?

It’s confusing for me at the moment, and this post is to get my head straight before I jump into it and keep the downtime at a minimum.

I use this excellent add-on (letsdnsocloud):

and this tutorial to set up nginx :

(but I forwarded 443 and 8123 in my router)

HA.mydomain.com is maintained by letsdnsocloud, grafana.mydomain.com etc… are just C-Names.

1 Like

I just went far down the rabbit hole. Which NGINX addon/integration do you use? I just browsed this topic: SSL with additional domain, seems to do the same, but with a different approach…

I will not be able do this just yet, but based on what I’ve been reading, Nginx Proxy Manager can handle the reverse proxy, automatic SSL certificate updates and even host my website, so I don’t even need Apache2. I will forward my router ports 80 and 443 to that add-on. It does require the MariaDB add-on to function, but from what I can dig up, it’s highly recommended to use MariaDB instead of the default Hass DB anyway, so it’s a win-win. Finally, I’ll need the Cloudflare integration to keep the DNS records updated with my IP as it is dynamic. I think that’s it, really looking forward to trying it out :smiley:

how do you setup the subdomain aaa.website.com in cloudflare so that it forwards it to the ningx?

1 Like