Home Assistant & NGINX - edgecase?

Been struggling to get this working with NGINIX – ending up with 404 or 502. All the documentation I’ve found refers to a setup with foo.host.com or just host.com (and upgrading http->https in the proxy process) and I’m trying to get this working using https://host.com/hass (in my case.) Got Portainer, OpenZWave, etc all running in dockers and reverse-proxied without issue but can’t get this working to save my life.

I followed all the configs, documentation and suggestions I could find via search but none really applied to me. It always ends up with the http errors mentioned above because while the “index” file loads, /frontend/ and /static/ directories end up being a 404 (so it can’t find them) or I get the infamous bad gateway.

Has anyone been able to get this working in line with what I’m trying to do? I have it running as https://host.com:8123/ without issue for a year now, never had any issues but I’d like it hide it behind https://host.com/hass/ instead so I can drop the port-forwarding, etc I currently have in place. I recently just upgraded Home Assistant to run in a docker (don’t know how I lived without this to be honest) and it works perfectly fine with my existing config.

Can’t be done, needs to be hass.host.com

You’ve never needed to forward port 8123 though, nginx receives on 80/443 and then routes to your internal ip at 8123, that’s kind of the point of the proxy.

I use OMV running Nginx and I’m able to proxy all sorts of things under domain.com/location without the port forward. If I understand you though, I can drop the port forward (physical) and just proxy the port internally? Not sure that’ll work because that’s basically what I’m trying to do but with an URL. It’s literally the only thing I have that doesn’t want to play nice this way.

As I said, everything but HA works in this case, no port forwards required.

It will if you do it as a subdomain (location.domain.com), that’s how we all do it.

It won’t work as as domain.com/location because of how homeassistant is designed.

Thanks. Came across another post this morning about a non-configurable webroot. So my choices are either keep it as-is (shortFQDN:port + forward from router) or longFQDN + proxy.