语法: init_by_lua_file <path-to-lua-script-file>
环境: http
阶段: loading-config
与init_by_lua等价,通过<path-to-lua-script-file>
指定文件的Lua 代码 或 Lua/LuaJIT 字节码来执行。
当给定了一个相对路径如foo/bar.lua
,它将会被转换成绝对路径,前面增加的部分路径是Nginx服务启动时通过命令行选项-p PATH
决定的server prefix
。
该指令在v0.5.5
发行版第一次被引入。
English source:
syntax: init_by_lua_file <path-to-lua-script-file>
context: http
phase: loading-config
Equivalent to init_by_lua, except that the file specified by <path-to-lua-script-file>
contains the Lua code or 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.5
release.