I think the https URL should work both inside and outside your network. For me it does, but I can no longer use the IP address of the computer running hass to access it inside the network.
Iām not a network expert so I canāt really explain this behavior. I would look at the router config, and go through all settings for the IP of the computer running hass.
The FQDN (sub.domain.com) āshouldā work, but if you use the local/internal IP address, then it will not resolve to the external sub.domain.com id, and therefore would fail.
Yeah, thankā¦but the issue is that guide donāt use the path but only sub-domain.
Home assistant does not use relative path for internal resource, but only absolute pathā¦that fight with the virtual host with a sub path (ei. domain.com/hass/)
But internally, my DNS server (router) replies with the internal IP of my HASS box for this subdomain
My hass is running on default 8123 with SSL (why not), and my nginx is running on 8124
My router port forwards 8124 to nginx, and hass is not exposed externally
Hass does not have a password configured
Then my nginx config is below (there are comments inline, and things you need to change).
End result: https://hass.example.com:8124 works externally and internally. Authentication is required only externally. https://hass.example.com:8123 goes to HASS internally (only), but I donāt often use it (you could switch the ports as long as you do it consistently).
The issue is when you have a Virtual Host with a sub path (sub.domain.com/hass), this because the links (js, css, imgs, etcā¦) inside the html of Hass are absolute and not relative.
I guess this could be consider a bug (all web app should be able to install under a sub path, and not only in the DocumentRoot)
@AlucardZero: aynyway, I though, why you donāt add hass.example.com in the internall dns, and you can say to ngnix that:
Request come from your router ip (external) display login form (auth)
Request that come from others internal ip (internal) donāt display login form
So, you can avoid to switch from a port to another