# How to host static content from a sub folder

**URL:** <https://discourse.nodered.org/t/how-to-host-static-content-from-a-sub-folder/52928>\
**Category:** General\
**Created:** [29 October 2021 07:05 UTC](https://discourse.nodered.org/t/how-to-host-static-content-from-a-sub-folder/52928 "2021-10-29T07:05:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roaders](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/roaders/32/11282_2.png) [@Roaders](https://discourse.nodered.org/u/Roaders)\
**Post date:** [29 October 2021 07:05 UTC](https://discourse.nodered.org/t/how-to-host-static-content-from-a-sub-folder/52928/1 "2021-10-29T07:05:38Z")

</div>

Hi All  
I have some static content (and index page and some javascript) that I want to host on the same machine as node-red. Can I host this using node red? I saw something about static in the config file but it seemed to be served from the root folder.  
Thanks

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [29 October 2021 07:58 UTC](https://discourse.nodered.org/t/how-to-host-static-content-from-a-sub-folder/52928/2 "2021-10-29T07:58:39Z")

</div>

Have you searched for an answer?  
Try googling 'node-red static files', there are lots of examples.

---

<div class="post-metadata">

**Author:** ![Roaders](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/roaders/32/11282_2.png) [@Roaders](https://discourse.nodered.org/u/Roaders)\
**Post date:** [29 October 2021 08:10 UTC](https://discourse.nodered.org/t/how-to-host-static-content-from-a-sub-folder/52928/3 "2021-10-29T08:10:07Z")

</div>

yes I have tried searching. That's where I found the information about the static settings but as I said it seemed to only be served from the root.

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [29 October 2021 08:13 UTC](https://discourse.nodered.org/t/how-to-host-static-content-from-a-sub-folder/52928/4 "2021-10-29T08:13:10Z")

</div>

And if you include a directory under the location you set as `httpStatic`...

---

<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:** [28 December 2021 08:13 UTC](https://discourse.nodered.org/t/how-to-host-static-content-from-a-sub-folder/52928/5 "2021-12-28T08:13:46Z")

</div>

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