# httpStatic behind nginx-proxy

**URL:** <https://discourse.nodered.org/t/httpstatic-behind-nginx-proxy/16299>\
**Category:** General\
**Created:** [4 October 2019 07:37 UTC](https://discourse.nodered.org/t/httpstatic-behind-nginx-proxy/16299 "2019-10-04T07:37:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![antsve](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@antsve](https://discourse.nodered.org/u/antsve)\
**Post date:** [4 October 2019 07:37 UTC](https://discourse.nodered.org/t/httpstatic-behind-nginx-proxy/16299/1 "2019-10-04T07:37:28Z")

</div>

I've set up node-red to behind a nginx-proxy and have a hard time to reach the httpStatic content. If i connect to localhost:1880/test.png (test.png is within httpStatic folder) it works fine. But when i try to use the same file in template node as such:

```auto
<div> <button onclick="window.location.href = "google.com"><img src="/test.png"></button></div>

```

I only get 404 not in console.

This is snippet rom my node-red settings.js:

```auto
                                                                                   
httpAdminRoot: '/admin',                                                                                                                                                                                                                                                                                                                               
httpNodeRoot: '/node-red',                                                                                                                                                                                                                      
//httpRoot: '/node-red',
httpStatic: '/home/antsve/node-red', 

```

and this is the nginx.settings for my host:

```auto

                                                                                                                       
location /node-red {
              proxy_pass http://127.0.0.1:1881/node-red;                                                                              
              proxy_http_version 1.1;                                                                                                 
              proxy_set_header Upgrade $http_upgrade;                                                                                 
              proxy_set_header Connection "upgrade";                                                                                  
              proxy_set_header X-Forwarded-Host $host:server_port;                                                                    
              proxy_set_header X-Forwarded-Server $host;                                                                                 
              proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
}

location /admin {                       
              proxy_pass http://127.0.0.1:1881/admin;                                                                                 
              proxy_http_version 1.1;                                                                                                 
              proxy_set_header Upgrade $http_upgrade;                                                                                 
              proxy_set_header Connection "upgrade"; 
}

location /static {
              proxy_pass http://127.0.0.1:1881;
              proxy_set_header X-Forwarded-Host $host:server_port;
              proxy_set_header X-Forvarded-Server $host;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
 

```

anyone have any suggestions to what im doing wrong?

---

<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:** [4 October 2019 12:21 UTC](https://discourse.nodered.org/t/httpstatic-behind-nginx-proxy/16299/2 "2019-10-04T12:21:18Z")

</div>

Looks like your static resources would be accessible from `http://youraddress/static/....` according to the config you've shown.

```auto
<img src="http://youraddress/static/test.png">

```
