Local and remote access to HA together

Hi, I have a problem with my configuration consisting of a Rpi 3 with HAos on which I have remote access configured and working with duckdns and port 8123 open on the modem.
My problem is that with this setup I can’t access HA at the local IP address. Is there a way that allows me to access both locations at the same time? I’m not sure, but I don’t want that having another rpi with remotely accessible Nextcloud configured to which I have opened ports 80 and 443, it doesn’t allow me to have access to remote and local HA with active nextcloud. Has anyone else had similar problems or a setup like this?

Instead of enabling https on home assistant, keep it on http and setup nginx reverse proxy for remote access.

You can use http url for local access (companion app settings) and remote url for external access.

Or just use the external URL and rely on router hairpinning (NAT loopback) when on your local network.

I was purely using https and relying on my router as you called out, until i had issues with nuki integration which requires http callback urls and doesn’t support https, so went to nginx based solution.

Thank you, to have reverse proxy I should have ports 80 and 443 open, but these ports are already occupied by nextcloud server on another raspberry in the same network with apache2 server.
Given that I would not know how to reverse proxy (but I can learn it with the various guides that are there for Apache), perhaps keeping the current configuration on the nextcloud server, should I make sure that it is possible to reverse proxy the Rpi with nextcloud to the Rpi with HA, so that both can work? I could always access it from https too right?

Thanks, I tried this method (because it’s simpler and faster), but it doesn’t work in https (I tried to manually create a new certificate for the remote access address of the modem - a fritzbox -, but without success), only in http and local, maybe it’s normal that https doesn’t go. The only way I know to make it work is adding two lines in config.yaml but in this case I would lose access with local IP and http (going back to my starting condition).

  • Add your external domain name to your internal network (on your local dns server (== router?)) f.e. domain.mine
  • Bind your HA’s name to IP (f.e. home)

Then use https://home.domain.mine as external URL and https://home.domain.mine:8123 as internal URL :wink: