# Weird Httpstatic configuration in Setting.js in NR windows 11

**URL:** <https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765>\
**Category:** General\
**Tags:** node-red-dashboard\
**Created:** [29 October 2022 10:12 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765 "2022-10-29T10:12:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [29 October 2022 10:12 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/1 "2022-10-29T10:12:08Z")

</div>

Node.red 3.0.2, Windows 11 Pro, Nodes v. 16.17

Hi,  
My flow uses the template node with images stored inside a "domotica" folder inside ".node-red" folder inside current user "rober" folder.

As you can see underlined in yellow in Settings.png file I uncommented the HTTPStatic line in Settings.js in order to show them in template node, writing with Notepad editor:

httpStatic: 'C:\Users\rober\.nodered\domotica\'

but in the dashboard template I always see the broken link icon!

When starting node-red I see a "dirty" httpstatic parameter reading (underlined in yellow in Httpstatic.png):

C:\Users\rober.node-red\domotica \> /

the parameter is not correctly terminated with the expected windows PATH identifier "\", but is concatenated by a weird " \> /" string. Is this the reason why the Httpstatic is not correctly configured?

I understand that the problem lies here, but I don't know how to solve it. Should I replace the Settings.js in the User/.node-red/ with the original one installed in User/AppData/Roaming/npm/Node\_Modules/node-red?

TIA

 ![Settings](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/4/140f4c2cc7ae2d4c86cffe04d013a227d3470afd.jpeg)

 ![HTTPStatic](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/9/c9df319b997c6188c26703240a910ee210fa2e59.jpeg)

---

<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:** [29 October 2022 11:05 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/2 "2022-10-29T11:05:47Z")

</div>

> [@Robertotarga](#):
>
> the parameter is not correctly terminated with the expected windows PATH identifier "", but is concatenated by a weird " \> /" string. Is this the reason why the Httpstatic is not correctly configured?

No, if you use a proper editor you would see that is simply a comment...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/3/e3d60e3e83d4609f863ca6cb9780d998f51c3b91.png)

---

<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:** [29 October 2022 11:07 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/3 "2022-10-29T11:07:16Z")

</div>

> [@Robertotarga](#):
>
> TIA
> 
> ![Settings](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/4/140f4c2cc7ae2d4c86cffe04d013a227d3470afd.jpeg)

Where is this particular file? in `.node-red` or in `User/AppData/Roaming/npm/Node_Modules/node-red`?

---

<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:** [29 October 2022 11:09 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/4 "2022-10-29T11:09:14Z")

</div>

> [@Robertotarga](#):
>
> ![HTTPStatic](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/9/c9df319b997c6188c26703240a910ee210fa2e59.jpeg)
> 
> HTTPStatic1620×884 190 KB

The highlighted text is stating that files in `C:\Users\rober.node-red\domotica` \> will be presented to the browser \> at path `/`

For example, you could set the `httpStaticRoot` to `"my_web_stuff"` and it would show you...  
`C:\Users\rober\.node-red\domotica > /my_web_stuff/`

  

As of NR 3, you can also do this...

```auto
httpStatic: [{path:'C:\\Users\\rober\\.node-red\\domotica', root: "/docs/"}]

```

and you will be shown...  
`C:\Users\rober\.node-red\domotica > /docs/`

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [29 October 2022 12:28 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/5 "2022-10-29T12:28:00Z")

</div>

Hi Steve,  
The file I edited is in .node-red folder

---

<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:** [29 October 2022 12:29 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/6 "2022-10-29T12:29:20Z")

</div>

Ok. That's the right one. Does my explanation help you?

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [29 October 2022 14:30 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/7 "2022-10-29T14:30:35Z")

</div>

Unfortunately no Steve, I keep on seeing all images inside the template node with the "broken link" icon.  
If I type the full path of the image on the browser:

C://Users/rober/.node-red/domotica/myImage.png

I can see it

I'm trying to paste some html code here to let you see my code, but in the body message preview the html is always interpreted. I can avoid it and passing it as pure text?

---

<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:** [29 October 2022 14:41 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/8 "2022-10-29T14:41:32Z")

</div>

Use the code button `</>` before posting code

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [29 October 2022 14:43 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/9 "2022-10-29T14:43:19Z")

</div>

Inside the template node the images have a tag : "IMG SRC = "/MyImage.png".  
I also tried "IMG SRC = "MyImage.png" without the forward slash to no avail.

BTW this flow has been moved from a Raspberry Pi machine where it still works perfectly. It's on Windows 11 only where I have this problem

---

<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:** [29 October 2022 14:44 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/10 "2022-10-29T14:44:58Z")

</div>

Can you show content of the folder? Is that file present? Have you checked file permissions? What account runs node-red?

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [29 October 2022 15:13 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/11 "2022-10-29T15:13:00Z")

</div>

Can you show content of the folder? YES

Is that file present? YES, the browser can display it

Have you checked file permissions? Read/Write on all files in folder "domotica"

What account runs node-red? How can I see which "account" owns the node-red process? If it's installed in "rober" folder user the account should be the same

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 October 2022 16:10 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/12 "2022-10-29T16:10:54Z")

</div>

You can see the owner of the process using the Windows Task Manager. Switch to the Details tab to see the username. Mostly they will be your logged in user or `SYSTEM`.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [29 October 2022 17:02 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/13 "2022-10-29T17:02:20Z")

</div>

The address in use error is because you did not stop node red before starting it again, so the old settings file is still in use.

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [29 October 2022 17:02 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/14 "2022-10-29T17:02:23Z")

</div>

Thank you very much. In the details tab I found that the node task is owned by SYSTEM.  
Has it something to do with the fact that the template node cannot see the images contained in the folder referenced by HTTPStatic?

Roberto

 ![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/0/a03c4e1a54d6b4933b3908cc0b4106762c4b7616.jpeg)

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [29 October 2022 17:04 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/15 "2022-10-29T17:04:07Z")

</div>

Hi Colin,  
I restarted the pc everytime I did a modification to the settings.js file

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [29 October 2022 17:10 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/16 "2022-10-29T17:10:37Z")

</div>

Hi Steve,  
from Task Manager details I see that node.exe is run by SYSTEM and this user has all the privileges on the images folder I struggle to see

 ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/9/c99f11e24d3f89dd89c8b2c155992609a6bc8015.png)

---

<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:** [29 October 2022 17:19 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/17 "2022-10-29T17:19:56Z")

</div>

If node-red is ran by system I suggest you try putting the images somewhere more system friendly.

Try for example, put your images in `c:\node-red\images` and set `httpStatic` accordingly

Be sure to check `system` has at least read access to `c:\node-red\images`

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [30 October 2022 10:54 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/18 "2022-10-30T10:54:22Z")

</div>

Hi Steve,  
I moved the "domotica" folder at root level C:\ and edited the settings.js accordingly:

httpStatic: 'C:/domotica/'

restarted node-red and seen the correct Static path:

C:/domotica \> /

where all content should be accessible from the "/" root

I verified that the SYSTEM user who owns the node.exe process has all privileges on domotica folder  
and all contained files

I made a super simple flow with one inject and a template node with this code:

```auto
<div> 
    Test png
    <img alt="Image not found" src ="/schemaloex.png" />   
</div> 

```

where "schemaloex.png" is one of the images inside "domotica"  
I inject the timestamp to run the template node but, as you can see, the image is not found.

 ![imagenotfound](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/2/425df28c92888dff0bcdb02090f20a61b7704a45.png)

I enclose the flow so you can check if I have made some erroneous configuration:

```auto
[
    {
        "id": "6027b4bab948526f",
        "type": "ui_template",
        "z": "641efd2eb7d562cf",
        "group": "63b3eeadbccc9412",
        "name": "SchemaLOEX",
        "order": 1,
        "width": "7",
        "height": "10",
        "format": "<div> \n Test png\n <img alt=\"Image not found\" src =\"/schemaloex.png\" /> \n</div> \n",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": true,
        "templateScope": "local",
        "className": "",
        "x": 540,
        "y": 1280,
        "wires": [
            []
        ]
    },
    {
        "id": "c51c11f3c74b761a",
        "type": "inject",
        "z": "641efd2eb7d562cf",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 240,
        "y": 1280,
        "wires": [
            [
                "6027b4bab948526f"
            ]
        ]
    },
    {
        "id": "63b3eeadbccc9412",
        "type": "ui_group",
        "name": "Termoregolazioni nei Piani",
        "tab": "9ebecd5c9ef57a7e",
        "order": 2,
        "disp": true,
        "width": "7",
        "collapse": false
    },
    {
        "id": "9ebecd5c9ef57a7e",
        "type": "ui_tab",
        "name": "Comfort",
        "icon": "dashboard",
        "order": 4,
        "disabled": false,
        "hidden": false
    }
]

```

I'm really desperate and frankly I don't know which other test/configuration I can make in order to be able to display images on template node via dashboard.  
Two things have changed moving the project from NR 1.x on a Raspberry Pi:

- NR version from 1 to 3.2
- platform from Raspberry to Windows

but I don't know what to blame.

I would like to add that the only way I was able to see the image "schemaloex.png" was using a file node pointing to that image, converted to base64 and passed as msg.payload to the template using this flow:

```auto
[
    {
        "id": "76f9c28c.8d324c",
        "type": "inject",
        "z": "9519c5e5bc8dfe67",
        "name": "",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 300,
        "y": 860,
        "wires": [
            [
                "91ff3a3e.591a38"
            ]
        ]
    },
    {
        "id": "696f92ca.600a9c",
        "type": "ui_template",
        "z": "9519c5e5bc8dfe67",
        "group": "63b3eeadbccc9412",
        "name": "",
        "order": 1,
        "width": "7",
        "height": "8",
        "format": "\n prova con base64\n <img width=\"100%\" height=\"100%\" alt=\"Image not found\" src=\"data:image/png;base64,{{msg.payload}}\" />\n",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": false,
        "templateScope": "local",
        "className": "",
        "x": 1030,
        "y": 860,
        "wires": [
            []
        ]
    },
    {
        "id": "91ff3a3e.591a38",
        "type": "file in",
        "z": "9519c5e5bc8dfe67",
        "name": "",
        "filename": "C:\\domotica\\schemaloex.png",
        "filenameType": "str",
        "format": "",
        "chunk": false,
        "sendError": false,
        "encoding": "none",
        "allProps": false,
        "x": 570,
        "y": 860,
        "wires": [
            [
                "e66563f4.00136"
            ]
        ]
    },
    {
        "id": "e66563f4.00136",
        "type": "base64",
        "z": "9519c5e5bc8dfe67",
        "name": "",
        "action": "str",
        "property": "payload",
        "x": 850,
        "y": 860,
        "wires": [
            [
                "696f92ca.600a9c"
            ]
        ]
    },
    {
        "id": "63b3eeadbccc9412",
        "type": "ui_group",
        "name": "Termoregolazioni nei Piani",
        "tab": "9ebecd5c9ef57a7e",
        "order": 2,
        "disp": true,
        "width": "7",
        "collapse": false
    },
    {
        "id": "9ebecd5c9ef57a7e",
        "type": "ui_tab",
        "name": "Comfort",
        "icon": "dashboard",
        "order": 4,
        "disabled": false,
        "hidden": false
    }
]

```

At least we know that this image exists, is readable, but not thru the template node.  
As you can well imagine I cannot pass all my images reading from them from file system, converting as base64 streams and passing as objects whereas before I just typed their name!

Do you personally use NR on a Windows 11 machine?

Please help!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 October 2022 11:09 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/19 "2022-10-30T11:09:18Z")

</div>

If you put [http://IP:1880/schemaloex.png](http://IP:1880/schemaloex.png) in a browser window does it work?

---

<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:** [30 October 2022 16:08 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/20 "2022-10-30T16:08:43Z")

</div>

I dont know what to say - It works as expected...

#### The template content

```html
<div>
    HTML: <pre> &lt;img alt="Image not found" src ="/schemaloex.png" /&gt; </pre>
    <img alt="Image not found" src ="/schemaloex.png" />   
</div>   

```

#### Directory

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/a/1a014b957729d4f330b250a2641cd1c687dfcd0b.png)

#### Settings file...

```javascript
    httpStatic: 'c:/domotica',

```

#### Dashboard Result

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/3/f3c648b9634c147fcc0959462619f4579c3f73a0.png)

  
  

> [@Robertotarga](#):
>
> I inject the timestamp to run the template node but, as you can see, the image is not found.

There is no need to inject anything at all. Injecting into ui-template node is for dynamic runtime changes.

What I showed you above was jut 1 single unconnected ui-template node

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/a/ead1a7e74265b4014a5c84404fba5c651fdcbd64.png)

  
  

> [@Robertotarga](#):
>
> ![imagenotfound](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/2/425df28c92888dff0bcdb02090f20a61b7704a45.png)
> 
> imagenotfound746×876 9.42 KB

What does your browsers devtools reveal?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/e/ce0527d3fd4c866baaaf5f9093f8e9c0dfe5b451.png)

[Next page](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765.md?page=2)
