title: Nginx: Grant access by comparing a header value with the contents of a file; possible?
body: <p>I want to restrict access to some <strong>static</strong> files by comparing a custom header value with for instance an entry in a file. Basically I want to generate such a token in another (restricted) app and have Nginx  deny all requests with non matching headers and header values (the token).</p>
  
  <p>What I've read so far is, that with the <a href="http://wiki.nginx.org/HttpLuaModule" rel="nofollow">HttpLuaModule</a> its possible to extend Nginx writing Lua code. But I have no idea if my idea is by any chance working out. </p>
  
  <p>So, is there a simple solution using standard nginx modules (preferred)? Or is installing the Lua module by reinstalling/compiling nginx including the before mentioned module my only chance?</p>