FlowFuse / FlowFuse/node-red-dashboard

Third party nodes not working when dashboard is accessed via proxy unless admin route also proxied directly

Open
#1,615 17 comments 0 reactions 0 assignees View on GitHub
initiative:dashboards needs-triage type:bug
Dominant language
HTML
Stars
355
Forks
82
Avg merge
4d 20h
Merged PRs (30d)
24

Description

### Current Behavior

[Editted description following analysis described in comments below]

If the dashboard is accessed via a proxy then it may not be possible to load third party ui nodes. The reason is that then the node's `umd.js` file is loaded it is fetched using the httpAdminRoute setting (which may be empty) rather than the dashboard route. If the admin route is not also proxied then the fetch fails with a 404 Not Found error.

For example, if httpAdminRoute is set to `flow_editor` then the url used for the classic gauge js file is
`http://domain/flow_editor/resources/@colinl/node-red-dashboard-2-ui-gauge-classic/ui-gauge-classic.umd.js`
This will only work if `flow_editor/` is proxied to `flow_editor/`

I assume that the file should be accessed via the dashboard route so that it does not rely on the admin route being proxied.

[Original description]
When Tailscale is used to connect to a server running node-red, with https, then, in the dashboard, third party ui nodes do not work.
In the developer console I see, for example, a 404 error fetching
`https://xxx.tailxxx.ts.net/resources/@colinl/node-red-dashboard-2-ui-gauge-classic/ui-gauge-classic.umd.js`
Using tailscale I have proxied /dashboard to localhost:1880/dashboard, and I access the dashboard using https://xxx.tailxxx.ts.net/dashboard. I suspect that the failing uri should actually be
`https://xxx.tailxxx.ts.net/dashboard/resources/@colinl/node-red-dashboard-2-ui-gauge-classic/ui-gauge-classic.umd.js`

If I access the dashboard through tailscale using `http://xxx.tailxxx.ts.net:1880/dashboard` then it is fine

Most likely this is the same problem as #1612

### Expected Behavior

_No response_

### Steps To Reproduce

_No response_

### Environment

- Dashboard version: 1.22.1
- Node-RED version: 4.0.8
- Node.js version: 22
- npm version:
- Platform/OS: Ubuntu
- Browser: Edge

### Have you provided an initial effort estimate for this issue?

I am not a FlowFuse team member

Contributor guide

No contributing guide indexed for this repository

Research direction

Trace how the dashboard builds the URL for a third-party node's umd.js resource, comparing the dashboard route with httpAdminRoute. Reproduce the failure through the proxied /dashboard path without proxying the admin route, then verify that the resource loads successfully and existing direct-access behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.