OK, so I’ve been searching for a couple of weeks now. I’ve read just about all the nginx posts and articles I can find, but simply can’t figure this out.
Per the config below, I’m hosting HA and three other apps behind an nginx reverse proxy. Because HA doesn’t have any sort of url root option, I’m forced to access it via the root on nginx (I’ve tried all the other tricks I can find about giving HA a separate URI of its own on nginx, but none of those work).
The problem is, whenever I access apps 1, 2 or 3, I get the Home Assistant screen (which fails to load under the relevant ‘app’ URI). If I force Chrome to bypass cache (or empty my browser cache), I get the expected app. But, the second I do a regular refresh, I get Home Assistant again.
If I flush my browser cache, everything is fine - until I visit Home Assistant again. Then I have the same problem. The real issue is that there’s no way to bypass cache on a smartphone, except in incognito mode, which means I have to provide my htpasswd login each time - equally annoying.
Has anyone successfully hosted multiple apps (including HA) behind nginx?
Thanks in advance.
PS: the reason I listen on 127.0.0.1 is because I use sslh to have both ssh and ssl on port 443.
Here’s what worked on mine…seperate out your apps into different server blocks, give each a unique name. You can point dns records for each back to the same IP (or CNAME each to the main home assistant A record, either method should work).
Thanks for that. Seems to be working now. I did try this method before posting, but suspect I left the HA instance configured with default_server, and visiting the root of the non HA instance sent me there.
Either way, it’s working with the separate name. Thanks for your help.