danielperna84 / hass-configurator

Configuration UI for Home Assistant
MIT License
313 stars 168 forks source link

Wrong API links behind nginx reverse proxy #149

Closed mdenadal closed 5 years ago

mdenadal commented 5 years ago

Hello, I run Home Assistant behind Nginx mostly for https and Letsencrypt (manual installation, no hass.io). Home Assistant works fine, the translation is kinda: https://home.xyz.com -> http://127.0.0.1:8123

I would like to add hass-configurator without using a different tcp port. Something like: https://home.xyz.com/config -> http://127.0.0.1:3218.

The problem is with hass-configurator's api links, the link called by hass-configurator is something like: htts://home.xyz.com/api/listdir?path=. instead of: htts://home.xyz.com/config/api/listdir?path=.

Am I missing something or is this a bug? Thanks.

danielperna84 commented 5 years ago

I think that's a fault in your configuration. Other people have reported success in running the configurator behind a reverse proxy. The links in the code also are relative. The first though that comes to my mind: /config is actually invalid for a reverse proxy entry. That would only point to one single resource. It has to be /config/ to be a proper location with possible sub-elements (the api in this case). Without the trailing / it is as if you are linking to a single file. Which initially works because the configurator itself only is a single file with all resources fetched from CDNs. But the API endpoints that get called when using the configurator are separate virtual resources within the same folder.

mdenadal commented 5 years ago

Yes, you are right! The trailing / did the job. Thank you very much.