0

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

vidarlo
  • 6,654
  • 2
  • 18
  • 31

1 Answers1

0

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.
vidarlo
  • 6,654
  • 2
  • 18
  • 31
  • 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 / ? – JokerGermany Dec 28 '22 at 11:46
  • Go with subdomains. – vidarlo Dec 28 '22 at 12:17