我有一個反向代理nginx的與在nginx.config以下運行:nginx的access_by_lua不尊重lua_package_path
http {
lua_package_path ";;$prefix/?.lua;?.lua;/etc/nginx/?.lua;/etc/nginx/resty/?.lua;";
}
,然後多個位置,在服務器:
# xxx SERVICE
location ~* ^/articles/?(.*) {
proxy_ignore_client_abort on;
include cors.conf;
access_by_lua_file nginx_v4.lua;}
進出口運行這個CentOS的7與nginx和lua配置在/etc/nginx/和我給我的lua包路徑。當我運行nginx的,它工作正常導入LUA文件(找到它在lua_package_path),但由於某些原因,當我運行它失敗,出現以下的XXX服務:
> 2016/10/11 16:37:21 [notice] 19300#0: getrlimit(RLIMIT_NOFILE):
> 1024:4096 2016/10/11 16:37:21 [notice] 19301#0: start worker processes
> 2016/10/11 16:37:21 [notice] 19301#0: start worker process 19303
> 2016/10/11 16:37:25 [error] 19303#0: *1 failed to load external Lua
> file "/usr/share/nginx/nginx_v4.lua": cannot open
> /usr/share/nginx/nginx_v4.lua: No such file or directory, client:
> 10.1.104.135, server: localhost, request: "GET /content/search?filter.search_string=goog HTTP/1.1", host: "x.x.x.x"
> 2016/10/11 16:37:41 [info] 19303#0: *2 client closed connection while
> waiting for request, client: 10.1.104.135, server: 0.0.0.0:443
由於某種原因,它在/ usr看對於LUA文件/股/ nginx的,實際上在於在/ etc/nginx的:**文件 「/usr/share/nginx/nginx_v4.lua」:無法打開
在/ usr /共享/ nginx的/ nginx_v4。 lua:沒有這樣的文件或目錄**
任何想法爲什麼?直到我對路徑進行硬編碼之前,這不起作用。