How to set internal and external urls

I have had DuckDns and Lets Encrypt set up for years and everything works great until my internet goes out. I cannot access home assistant on my internal network. I must go out of my network and come in through my router.

image

This is the only http config my configuration file:

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

How do I set an internal url so I can access HA without needing the internet?

You can’t really do it with that. You have two options:

  1. Get a router that supports hairpinning (NAT Loopback), or
  2. Set up a reverse proxy like NGINX or Caddy. Addons are available.

Edit: there is a third option.

If you go to http://<ip_address>:8123 in your web browser you should be able to add a security certificate exception that allows you to access Home Assistant.

I have a Ubiquity USG and it has NAT Loopback enabled. But I am not sure how that helps me? If I try to access my DuckDns url it resolves to my public ip address.

Then visiting your duckdns address should be redirected to the internal address by your router.

It does not.

1 Like

I’ve got the same problem

You need DNS to continue working when your internet is down, hence you need a local DNS server, something like AdGuard. This is how I solved this issue. You can run adguard home as a docker container. Some routers support running adguard as well, like openwrt and opnsense.

NAT reflection will not help, as the router uses DHCP to get its public IP, meaning it’s not statically configured and if your Internet goes down, the router loses its public IP and NAT reflection (aka NAT loopback) cannot work anymore.