Nginx and duckdns

I moved from standard Https with the duck DNS add-on, across to nginx today.
There’s so many threads on people having issues, that I wanted to just specify what I did to make it work.

In configuration.yaml
Comment out the http section

Restart home assistant
Check you can connect internally

In router / firewall:
Remove existing port forwards
Add fowrading to the device running nginx on ports 80:80, 81:81, and 443:443

Install the mariadb addon
Install the nginx proxy manager add-on by Frenck
Follow the instruction in frencks gif

You should now have access internally over http and externally over Https.

I then had to go to Google console and update the address it uses to send commands to ha. Just had to remove :8123 from the middle of the URL. There may be places in your config where you also need to remove the :port part of the base url, for example in google text to speech.

All up and working in about 15 mins.

3 Likes

Want to change the category to #projects or #community-guides?

Are you sure about not needing to forward any ports? When I remove my forward of port 443 I can no longer connect. I’m not sure how anything would get past your router without the forward, unless you’re also using Nubu Casa.

8. Port forwarding
On your router, setup port forwarding (look up the documentation for your router if you haven’t done this before).
Forward port 443 (external) to your Home Assistant local IP port 443 in order to access via https.
Also forward port 80 to your local IP port 80 if you want to access via http.
Do enable LAN Local Loopback (or similar) if you have it.
Do not forward port 8123.

next line down, ill make it clearer, thanks

Hi, I’m playing Home Assistant on Synology NAS built into a Virtual Machine and works fine, but I can’t connect it locally on LAN, just from remote using OpenVPN linked to my Asus RT-AC88U router

Duckdns & NGINX addons are installed and working fine too

So I tried this “workaround” but when I start the addon-nginx-proxy-manager, it says that the port 443, forwarded to the HA ip, is already used and the addon stops!

Any idea? Thanks in advance

Have you commented out http: lines in home assistant config?
If so is there something else on the Synology using that port?

Hi samnewman86, I don’t think so:

  • deleted all the http lines

  • the HA Virtual Machine’s ip is different from the NAS/DSM ip, and inside there is only the HA installation made from the image

Can you access locally with ipadress:8123

Hi samnewman86, no I can’t

I found that I need to stop the NGINX addon and leave just the nginx add-on by Frenck active (this was the conflict with 443 port) now it starts…configured in NGINX site and mapped…

Still have no connection in local, just from remote…!!

That’s correct, you can’t have two nginx servers running

Hi, By the way still on remote access due also to NAT Loopback unsupported on my router

I Tried to follow some dmsmasq iptables rules but nothing to do! NGINX doesn’t fix

Thanks & Regards

Very helpful. Thanks a lot.

Hey, does it matter if the ports are UDP / TCP? I’ve selected both.

Tbh I’m not sure, I did the same

1 Like

Did you have a letsencrypt cert on your duckdns? Since moving my domain to cloud flare and a dynamic dns, I generated a new certificate with the new dns. However, I get a certificate error showing that I my ip certificate is still with duckdns.

Yes, created by the nginx addon

is anyone having issues? My HA crashed a few days ago and i got back up and running with a snapshot. but now my remote access isnt working. I went back through the install procedure and everything seems fine, but i stil cant access remotely.

If you updated to 2021.7, read the breaking proxy changes

Hi Petro,
The breaking changes section isn’t helping me fix this.
Do I need to change anything in npm or Hass or both?
If so, what?

There’s about 40 threads about this already. Have you looked in the forums?