i divided my website into a public and a private area. All static files will be served by the nginx. Nodejs only check the credentitals and set the X-Accel-Redirect-Header on success. The problem is, if i set the header like:
res.setHeader('X-Accel-Redirect', '/protected/');
I get only access to the /protected/index.html not the subfolders with css, images ... Here is my nginx configuration:
location /protected {
internal;
access_log off;
log_not_found off;
expires max;
}
Is it possible to set a whole folder with subfolders in X-Accel-Redirect-Header and not only the index.html?
You'd have to set a header directing nginx to the specific resource that you wanted to serve up. For instance:
res.setHeader("X-Accel-Redirect", "/protected/images/smile.jpeg");
Or whatever is appropriate, based on the request.