# Running Node-RED behind reverse proxy using sub path

**URL:** <https://discourse.nodered.org/t/running-node-red-behind-reverse-proxy-using-sub-path/57791>\
**Category:** General\
**Created:** [4 February 2022 19:33 UTC](https://discourse.nodered.org/t/running-node-red-behind-reverse-proxy-using-sub-path/57791 "2022-02-04T19:33:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kellis5137](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kellis5137/32/55825_2.png) [@kellis5137](https://discourse.nodered.org/u/kellis5137)\
**Post date:** [4 February 2022 19:33 UTC](https://discourse.nodered.org/t/running-node-red-behind-reverse-proxy-using-sub-path/57791/1 "2022-02-04T19:33:35Z")

</div>

I'm trying to install Node-RED behind a nginx reverse proxy. I already have an application under the default "/". I'm setting the Node-RED path via the following:

`location /nodeRed { rewrite /nodeRed(.*) /$1 break; proxy_pass http://localhost:1880; }`  
The call to [https://myserver/nodeRed](https://myserver/nodeRed) is working, it is getting HTML back... However, the paths to the included javascript, etc, are under the default "/".

Is there a way to set the default path of NodeRED via environment variables, etc?

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [4 February 2022 20:02 UTC](https://discourse.nodered.org/t/running-node-red-behind-reverse-proxy-using-sub-path/57791/2 "2022-02-04T20:02:39Z")

</div>

> [@kellis5137](#):
>
> However, the paths to the included javascript, etc, are under the default "/".

And they are not loading ?  
Do the Devtools console in your browser give any clues ? (screenshot)

If you try (slashes)

```auto
location /nodeRed/ {                
proxy_pass http://localhost:1880/;       
}

```

[source1](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass)  
[source2](https://stackoverflow.com/questions/27089812/reverse-proxy-in-subdirectory-cant-find-static-assets) (last comment)

---

<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:** [5 April 2022 20:03 UTC](https://discourse.nodered.org/t/running-node-red-behind-reverse-proxy-using-sub-path/57791/3 "2022-04-05T20:03:00Z")

</div>

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