Friday 19 October 2018

Serving static files only to authenticated users

I have node/express app running behind an nginx proxy, all working perfectly, using nginx to server static files (e.g. all .css, .js, and .jpg ...)I would like to restrict access to some of these static files (particularity .jpg's) to only authenticated users in my node (using passport).What is the best way the achieve this whilst also maximizing the performance of nginx. X-Sendfile-Type X-Accel-Redirect seem to be the best thing I can find on the topic, but not entirley sure how to incorporate these into serving .js/.css/.jpg staticsthanks

Submitted October 20, 2018 at 01:06AM by hydroperox

No comments:

Post a Comment