I can’t read that error unfortunately so im not sure exactly what it says. But based on the config youre showing me you are definitely going to run into certificate issues on the internal url so I’m going to guess that error is telling you something like “this connection can’t be trusted” and asking if you want to proceed anyway.
The reason is ssl certificates are only valid for a specific domain. When you went through the letsencrypt process you got an ssl certificate for your external duckdns domain (https://example.duckdns.org in your example above). Youre trying to present that same certificate to people connecting to HA on https://homeassistant:8123. But that certificate isn’t for that domain so all clients (like your browser or the mobile app) are going to object and say this website is insecure and can’t be trusted since it’s presenting someone else’s ssl certificate.
This is the downside with the port forwarding approach, where you forward an external port directly to port 8123 on your machine running HA. It works but kind of makes your HA inaccessible via local url. Or somewhat accessible if you’re able to tell all clients connecting that way to ignore the certificate error.
I’d recommend looking at the nginx proxy manager add-on. It’s easy to set up and allows you to require https access on your external url but allow http access to your internal url when within your network. This way both urls work fine without certificate issues
I am not sure how I must config the nginx. For your info, the error message is something like: “There was an error with the connection, please check this”. But I can call exact this url in the browser and can access the page.
Yes so this is a certificate error. It occurs for the reason I described, you have an SSL certificate for a particular domain (something like https://example.duckdns.org) and you’re trying to use it for another domain its not intended for (https://homeassistant:8123). This causes a certificate error and clients by design don’t trust websites with certificate errors (for legitimate security reasons although its obviously annoying in this case).
Some clients, like your browser, allow you to get around this error by giving you an option to ignore certificate errors situationally. Other clients, like the mobile app it seems, do not give a way to get around this error and simply won’t let you connect to a website with a certificate error.
The easiest way to get around this is just to always use the external URL and don’t set the internal URL. Everything will work fine for you in this case but it will always be going through duckdns to get to your HA, even if you are inside your house. If you definitely want to use the internal URL when you are local then you have a few options, the easiest two are probably:
Set up Home Assistant cloud. This handles everything for you and allows you to use the internal URL and the external URL without certificate errors.
Set up NGinx Proxy Manager. To do that you follow the steps here to get the addon installed. Once in there You add a proxy host that looks like this:
Then you will have HA externally accessible using HTTPS and internally accessible over HTTP without certificate errors. You won’t need the Let’s Encrypt addon anymore if you do that, NPM takes care of getting and renewing your certificates for you.