# Subdirectories of httpStatic

**URL:** <https://discourse.nodered.org/t/subdirectories-of-httpstatic/99731>\
**Category:** General\
**Created:** [21 November 2025 10:11 UTC](https://discourse.nodered.org/t/subdirectories-of-httpstatic/99731 "2025-11-21T10:11:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [21 November 2025 10:11 UTC](https://discourse.nodered.org/t/subdirectories-of-httpstatic/99731/1 "2025-11-21T10:11:36Z")

</div>

On a Pi settings.js has httpStatic: '/home/pi/.node-red/node-red-static/'

I put weather icon files in /home/pi/.node-red/node-red-static/icons and then copied them into a subdirectory /home/pi/.node-red/node-red-static/icons/owm.

A ui-template correctly shows the first one, but fails with the second (any icon filename gives the same, incorrect arrow icon):

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

Here is the template code. There is CSS too of course.

```auto
<template>
<div class="dashboard-container" style="backgroundColor: #93c0e8;">
<div class="daily-row">
  <div class="icon-wrapper"><div class="weather-icon" style="--icon:url('/icons/212.svg');"></div><div class="icon-label">212</div></div>
  <div class="icon-wrapper"><div class="weather-icon" style="--icon:url('/icons/owm/212.svg');"></div><div class="icon-label">212</div></div>
</div>
</div>
</template>

```

So the question is, why isn't the file in the subdirectory served correctly?

The network tab of developer tools shows code 200 for both, but the number of bytes transferred is different.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/64c752a8ecc99f4632a95f3b131696584e0cd3b6.png)

Is there a limit to the depth that Node-red's web server can see?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [21 November 2025 10:24 UTC](https://discourse.nodered.org/t/subdirectories-of-httpstatic/99731/2 "2025-11-21T10:24:18Z")

</div>

> [@jbudd](#):
>
> Is there a limit to the depth that Node-red's web server can see?

It seems there must be: moving /home/pi/.node-red/node-red-static/icons/owm directory to /home/pi/.node-red/node-red-static/icons\_owm, the template can find and display the icons using the new pathnames.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [21 November 2025 10:26 UTC](https://discourse.nodered.org/t/subdirectories-of-httpstatic/99731/3 "2025-11-21T10:26:35Z")

</div>

@jbudd out of interest, can you try renaming the top level dir `icons` to `icon_test` - but still with the `owm` subdirectory?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [21 November 2025 10:48 UTC](https://discourse.nodered.org/t/subdirectories-of-httpstatic/99731/4 "2025-11-21T10:48:32Z")

</div>

When I change the directory structure to icon\_test and icon\_test/owm then both sets of icons are correctly served:

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

Looks like a browser cache issue? But I replicated the original problem with a second browser.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [21 November 2025 11:03 UTC](https://discourse.nodered.org/t/subdirectories-of-httpstatic/99731/5 "2025-11-21T11:03:45Z")

</div>

It's a clash between the built-in admin routes for serving icons (`icons/`) and what you have in `httpStatic`.

For example, if you set `httpAdminRoot` to `/editor` so you access the editor there instead of `/`, then you wouldn't have a clash (as the built-in icon route would now be `/editor/icons`)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [21 November 2025 11:04 UTC](https://discourse.nodered.org/t/subdirectories-of-httpstatic/99731/6 "2025-11-21T11:04:33Z")

</div>

Just to add, that's why you're getting the arrow icon instead - that's the default icon the admin icons route will serve.

---

<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:** [21 November 2025 11:35 UTC](https://discourse.nodered.org/t/subdirectories-of-httpstatic/99731/7 "2025-11-21T11:35:03Z")

</div>

> [@knolleary](#):
>
> For example, if you set `httpAdminRoot` to `/editor` so you access the editor there instead of `/`, then you wouldn't have a clash (as the built-in icon route would now be `/editor/icons`)

One of several reasons I ALWAYS move the Editor path.

This thread also made me spot an error in my standard settings.js! I normally have:

```js
httpStatic: process.env.httpStatic || path.join('.', 'public'),

```

But this is actually incorrect, at least for the way that I run Node-RED, because that points to folder where I run `npm start` (manually run on my dev PC). It should be:

```js
httpStatic: process.env.httpStatic || path.join(path.relative(process.cwd(), __dirname), 'public'),

```

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [21 November 2025 12:00 UTC](https://discourse.nodered.org/t/subdirectories-of-httpstatic/99731/8 "2025-11-21T12:00:45Z")

</div>

> [@knolleary](#):
>
> It's a clash between the built-in admin routes for serving icons (`icons/`) and what you have in `httpStatic`.

So the simple work-around is to treat "icons" and "editor" (and others) as if they were reserved words and structure the directories differently.  
"icons" works but "icons/subdirectory" doesn't.

Could the Node-red startup process look for these troublesome directories and issue a warning?  
(Maybe it already does - who looks at the startup logs? 🤭 )

---

<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:** [19 February 2026 12:01 UTC](https://discourse.nodered.org/t/subdirectories-of-httpstatic/99731/9 "2026-02-19T12:01:35Z")

</div>

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