语法: log_by_lua_file <path-to-lua-script-file>
环境: http, server, location, location if
阶段: log
除了通过文件<path-to-lua-script-file>
的内容指定 Lua 代码外,该指令与log_by_lua是等价的,该指令从v0.5.0rc32
开始支持Lua/LuaJIT bytecode的执行。
当给定了一个相对路径如foo/bar.lua
,它将会被转换成绝对路径,前面增加的部分路径是 Nginx 服务启动时通过命令行选项-p PATH
决定的server prefix
。
该指令是在v0.5.0rc31
版本第一次引入。
English source:
syntax: log_by_lua_file <path-to-lua-script-file>
context: http, server, location, location if
phase: log
Equivalent to log_by_lua, except that the file specified by <path-to-lua-script-file>
contains the Lua code, or, as from the v0.5.0rc32
release, the Lua/LuaJIT bytecode to be executed.
When a relative path like foo/bar.lua
is given, they will be turned into the absolute path relative to the server prefix
path determined by the -p PATH
command-line option while starting the Nginx server.
This directive was first introduced in the v0.5.0rc31
release.