title: For a nginx server , how to protect static resources with REST login?
body: <p>I have a nginx server running uwsgi and a python backend. I have a REST-API which is protected by login which returns a session cookie.</p>
  
  <p>Now I can see a problem in that some resources are free to download even if not authenticated. Resources which are simply returned as static content by nginx.</p>
  
  <p>I would like to protect the site so that all resources require a valid session cookie to be set.</p>
  
  <p>Is there a way to hookup nginx to check with the python backend before returning the static resource?</p>