Configurable WebRoot


#1

Quoting original post:

I don’t see it anywhere in the docs and it looks like (based on const.py) that the webroot is not configurable. This makes it difficult to run behind a reverse proxy (like nginx) to add SSL without having to do a bunch of fancy trickery.

See Github post for more info.


Reverse proxy to an url, not sub-domain (server.net/hass instead of hass.server.net)
Relative path for home assistant
#2

It doesn’t seem to do anything when I click the vote button, so I’m sounding off in the comments with “me too!”


#3

+1 Voting doesn’t work for me either…


#4

+1 Voting doesn’t work for me either…


#5

I can’t seem to vote either. But I would really like to see this feature as well.


#6

Is this still not a thing?


#7

Hi, new here.

I’ve just been looking at home-assistant for my automations and this is one of my requirements as well. I’ve got several things running behind Apache with basic auth and SSL, each in its own subdirectory (including zoneminder and some little DIY apps of my own using Django).

I’d like to add homeassistant seamlessly into that mix, but that means it has to live in a subdirectory.

A quick look at the code though shows it’s not going to be a small change. The paths from root seem to be hardcoded all over the place. It’s a shame, because const.py defines URL_ROOT which looks like it should be the right place to do it but it’s hardly used.


#8

+1

I would like to see this to… I have many web apps, services that are behind an nginx reverse proxy. I would like hass to be reachable under something like “/hass”.

Currently I run it on “/” but it causes strange redirects to “/” when I want to access for example “/nodered”, which is also reverse proxied through nginx.


#9

As the others here, I’d love this feature (for same reasons, nginx, reverse proxy, easy ssl etc’)


#10

+1 base_url should do this…


#11

Any progress regaring this problem?


#12

Hi,

A bit strange it is not possible for such a modern project.
As I do not have a domain, I remotely connect to my server via IP and I would want to have access through Apache reverse proxy in a sub-directory (other services hosted as well).
That feature would be awesome!.. or if anyone has any idea on how to configure apache to do so…

Thanks


#13

+1

this would be a great feature - I’m also struggeling at the moment to get HA runnung per apache proxy at a sub-path in the url … does anyone has a workaround?


#14

At the moment I am using a sort of workaround but this is very ugly…

in my /etc/apache2/sites-available/000-default.conf, I have placed:

ServerName 127.0.0.1
ProxyPass /api/websocket ws://localhost:8123/api/websocket
ProxyPassReverse /api/websocket ws://localhost:8123/api/websocket
<Location /hass>
  ProxyPass http://127.0.0.1:8123
  ProxyPassReverse http://127.0.0.1:8123
  RequestHeader set X-SCRIPT-NAME /hass
  RequestHeader set X-SCHEME http
</Location>

  ProxyPass /static http://127.0.0.1:8123/static
  ProxyPassReverse /static http://127.0.0.1:8123/static
  ProxyPass /frontend http://127.0.0.1:8123/frontend
  ProxyPassReverse /frontend http://127.0.0.1:8123/frontend
  ProxyPass /api http://127.0.0.1:8123/api
  ProxyPassReverse /api http://127.0.0.1:8123/api
  ProxyPass /local http://127.0.0.1:8123/local
  ProxyPassReverse /local http://127.0.0.1:8123/local

Obviously that means you cannot have any other services using /static /local /api /frontend on the same server…
You also need to sudo a2enmod proxy_wstunnel

And when accessing IP/hass, it does not redirect automatically to the states page, you have to click on the link.

If someone has better, please share! :grinning:


#15

It works! The problem I keep having is that Firefox memorise the cookies in a way that cut me access to the other services that I have on the same host but on different folders. Chrome instead seems to work.


#16

+1 for configurable WebRoot


#17

+1 as this is particularly useful when hass lives with other web services at the directory level. I’d love it so all my web stuff use the exact same ssl setup.


#18

+1! Needed for nginx ssl rev proxy.


#19

Anyone have a NGINX workaround?


#20

Sure there is a workaround, subdomains. Nginx is more than happy to handle as many as you need.

With letsencrypt you can make as many SSL certificate as you need and you can auto renew all of them with one command.

Yeah, it would be nice to have this feature, but it isn’t likely to happen so you might as well use subdomains instead.