# Node-red-dashboard's "Go to Dashboard" button in editor does not respect document.location.pathname

**URL:** <https://discourse.nodered.org/t/node-red-dashboards-go-to-dashboard-button-in-editor-does-not-respect-document-location-pathname/69246>\
**Category:** Dashboard\
**Tags:** node-red-dashboard\
**Created:** [19 October 2022 09:18 UTC](https://discourse.nodered.org/t/node-red-dashboards-go-to-dashboard-button-in-editor-does-not-respect-document-location-pathname/69246 "2022-10-19T09:18:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![psten](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/psten/32/69044_2.png) [@psten](https://discourse.nodered.org/u/psten)\
**Post date:** [19 October 2022 09:18 UTC](https://discourse.nodered.org/t/node-red-dashboards-go-to-dashboard-button-in-editor-does-not-respect-document-location-pathname/69246/1 "2022-10-19T09:18:23Z")

</div>

Hi,  
I'm writing this post the second time, as my original post got flagged by Akismet as spam and has been hidden for a good week now.

I'm running Node-RED in a docker container and behind a reverse proxy that I have very limited control over. This reverse proxy creates a route from ht#p://DeviceIP/lorem/ipsum/red to ht#p://127.0.0.1:1880/red.

I noticed that the "Go to Dashboard" Button in the Node-RED Editor points to ht#p://DeviceIP/red/ui, and not ht#p://DeviceIP/lorem/ipsum/red/ui

By changing the settings.js to

```auto
//ui: { path: "lorem/ipsum/red/ui" },

```

I can make the button point to the correct url, however this will also result in the dashboard now being served at ht#p://DeviceIP/lorem/ipsum/lorem/ipsum/red (as expected).

The issue boils down to [node-red-dashboard/ui\_base.html](https://github.com/node-red/node-red-dashboard/blob/69bccb57c8131693075c39c360515f3953fa1b90/nodes/ui_base.html#L1167) not including the document.location.pathname, in this case lorem/ipsum.

By changing it to

```auto
var lnk = document.location.host+document.location.pathname+RED.settings.httpNodeRoot+"/"+uip;

```

the button now points to the correct url, including the pathname set by the reverse proxy.

I'd like to contribute a pull request for this, but first wanted to discuss this here. You can see my changes also at [add pathname to show-dashboard button link · psten/node-red-dashboard@d8e4e90 (github.com)](https://github.com/psten/node-red-dashboard/commit/d8e4e90d8f843a7294a5b0fe3ba19c33eee6e4a4)

Anything that I missed, why document.location.pathname should not be included in the link to the dashboard?

Best regards,  
Philipp

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [19 October 2022 11:58 UTC](https://discourse.nodered.org/t/node-red-dashboards-go-to-dashboard-button-in-editor-does-not-respect-document-location-pathname/69246/2 "2022-10-19T11:58:16Z")

</div>

Hi @psten

If you raise a pull request to `node-red-dashboard` it will certainly be appreciated and considered.

Please be explicit/detailed in the PR description and add a link back (both ways) - thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 November 2022 11:59 UTC](https://discourse.nodered.org/t/node-red-dashboards-go-to-dashboard-button-in-editor-does-not-respect-document-location-pathname/69246/3 "2022-11-18T11:59:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
