title: nginx access_by_lua not respecting lua_package_path
body: <p>I have a reverse nginx proxy running with the following in the nginx.config:</p>
  
  <pre><code>http {
    lua_package_path ";;$prefix/?.lua;?.lua;/etc/nginx/?.lua;/etc/nginx/resty/?.lua;";
  }
  </code></pre>
  
  <p>and then multiple location in the server :</p>
  
  <pre><code> # xxx SERVICE
      location ~* ^/articles/?(.*) {
  
        proxy_ignore_client_abort on;
  
        include cors.conf;
  
        access_by_lua_file nginx_v4.lua;}
  </code></pre>
  
  <p>Im running this centos 7 with nginx and lua config at <strong>/etc/nginx/</strong> and that what I give in my lua package path. When I run nginx , it works fine to import the lua files (find it in lua_package_path) but for some reason when I run the xxx service it fails with the following:</p>
  
  <pre><code>&gt; 2016/10/11 16:37:21 [notice] 19300#0: getrlimit(RLIMIT_NOFILE):
  &gt; 1024:4096 2016/10/11 16:37:21 [notice] 19301#0: start worker processes
  &gt; 2016/10/11 16:37:21 [notice] 19301#0: start worker process 19303
  &gt; 2016/10/11 16:37:25 [error] 19303#0: *1 failed to load external Lua
  &gt; file "/usr/share/nginx/nginx_v4.lua": cannot open
  &gt; /usr/share/nginx/nginx_v4.lua: No such file or directory, client:
  &gt; 10.1.104.135, server: localhost, request: "GET /content/search?filter.search_string=goog HTTP/1.1", host: "x.x.x.x"
  &gt; 2016/10/11 16:37:41 [info] 19303#0: *2 client closed connection while
  &gt; waiting for request, client: 10.1.104.135, server: 0.0.0.0:443
  </code></pre>
  
  <p>for some reason it look in /usr/share/nginx for the lua file which actually lies in /etc/nginx : **file "/usr/share/nginx/nginx_v4.lua": cannot open</p>
  
  <blockquote>
    <p>/usr/share/nginx/nginx_v4.lua: No such file or directory**</p>
  </blockquote>
  
  <p>Any idea why ? This does not work until I hardcode the path .</p>