Help please :-) Does not populate entity_ids automatically!

Hi guys, pulling my hair out with this :slight_smile:

So I have Home Assistant running in a docker on unraid and Node Red running in another docker…

I access them via the lets encrypt docker / reverse proxy so I have SSL access internally and externally to the network.

If I open a status node up if I connect direct to the IP eg http://192.168.0.19:1880/node-red/#flow/d147397f.dbb958
then when it tries to pull the entity IDs I get this error

"
Cannot GET /homeassistant/entities
Cannot GET /homeassistant/entities"

If I access via https via NGIX eg https://realurlhere.net/node-red/#flow/d147397f.dbb958 I just get 404 not founds.

I have googled and found others with issue but not a fix that works for me - be grateful for anyadvice?

I have worked out that the cause of the error is when you change the httpRoot in the config or node-red as per below.

I need to change the http root to be able to reverse proxy with lets encrypt

// The following property can be used in place of ‘httpAdminRoot’ and ‘httpNodeRoot’,
// to apply the same root to both parts.
httpRoot: ‘/node-red’,

So for me it should be pulling the data from http://192.168.0.19:1880/node-red/homeassistant/entities

But it is actually trying to pull it from http://192.168.0.19:1880/homeassistant/entities

anyone got any ideas of a fix looks like the base url is hard coded and isnt taking account of the httproot value.

On line 47 of server-events-state-changed.html - we can see the url it fetches to show entities, as it does not take into account httpRoot variable I have done a quick and dirty hard code - I am sure there must be a better way of fixing this but I am not a coder :frowning: as you can see below all I have done is manually put in the additional info for my installation.

            $.get('/node-red/homeassistant/entities').done((entities) => {

I got to the bottom of this by adding an additional reverse proxy entry for the directory /homeassistant

For example, I have nodered set up to run out of ipaddress:1880/nodered

I have the main reverse proxy set up to forward requests from ipaddress/nodered to ipaddress:1880/nodered (also a rule for websockets)

So I set up another reverse proxy rule to forward requests for ipaddress/homeassistant to ipaddress:1880/nodered/homeassistant

I’m using Apache, but here is my reverse proxy setup.

ProxyPass /nodered/comms ws://localhost:1880/nodered/comms
ProxyPass /nodered http://localhost:1880/nodered
ProxyPassReverse /nodered/comms ws://localhost:1880/nodered/comms
ProxyPassReverse /nodered http://localhost:1880/nodered

ProxyPass /homeassistant http://localhost:1880/nodered/homeassistant
ProxyPassReverse /homeassistant http://localhost:1880/nodered/homeassistant

For reference, I have fixed this issue on my WebSocket fork if people need to use httpRoot or httpAdminRoot in their setup and want it working out of the box.