Score:0

Reverse Proxy - Using Subdirectory

hn flag

I cant use cname, therefore i would like to split my services into subdirectorys.

location /ha/  
    {
            proxy_pass              http://localhost:58123/;   #local IP of my HA server
            proxy_set_header   Host             $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_set_header   Upgrade          $http_upgrade;
            proxy_set_header   Connection       "upgrade";
        }

When i do this i get the HA Logo, but in the developer console i see that he tries to load files from the main side.

e.g. instead /ha/frontend_latest/app.83207343.js i get /frontend_latest/app.83207343.js

Score:0
ar flag

Yes, because your /ha/ page lists /frontend_latest/app.83207343.js as a resource. You have three ways to solve this:

  1. Tell your application that it should use relative paths, e.g. frontend_latest/app.83207343.js
  2. Tell your application that it should use absolute, but correct paths, e.g. /ha/frontend_latest/app.83207343.js.
  3. Use something like ngx_http_sub to do a rewrite on the fly.
JokerGermany avatar
hn flag
Thanks for the answer, but looks like HomeAssistant is stubborn and will never add this https://github.com/home-assistant/architecture/issues/156#issuecomment-478183627 Therefore 1 and 2 isn't working. I tried variant 3 a little bit, but it looks like then I never can run something on / ?
vidarlo avatar
ar flag
Go with subdomains.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.