Node Apps images are 404 when Cache-Control Header presents

pmjcreations

Verified User
Joined
Jul 3, 2019
Messages
116
Hello all,

I am trying to enable Cache-Control Header and in Nginx (reverse).

NGINX:
location ~* \.(js|css|png|jpg|jpeg|gif|svg|ico)$ {
 expires 30d;
 add_header Cache-Control "public, no-transform";
}

WordPress sites and other sites are working as expected.
But I have a Node JS app, that calls static asset from outside the public_html.

That is Root of the domain's account > nodeappfoldername > public > images.

When I add the Cache-Control Header rule, the images and other static assets were throwing 404. But if I disable this rule, all assets are rendering correctly.

I am using Cloudlinux's Node Selector.

Anyone can help me to fix this issue?
 
Back
Top