each worker process has it's own lua_State object in ngx_lua_main_conf_t structure.
syntax: lua_code_cache on | off
default: lua_code_cache on
context: main
syntax: lua_init <lua-script-str>
default: nil
context: main
phase: init process
When there is a syntax error or any other error with script it will write the log and still working.
syntax: lua_init_by_file <path-to-lua-script-file>
default: nil
context: main
phase: init process
When there is a syntax error or any other error it will write the log and still working.
syntax: lua_content <lua-script-str>
default: nil
context: location
phase: content
Each script must return a string or nil. When there is a syntax error or any other error with script it will pass to lua_error (high priority) or lua_error_by_file.
syntax: lua_content_by_file <path-to-lua-script-file>
default: nil
context: location
phase: content
Each script must return a string or nil. When there is a syntax error or any other error with script it will pass to lua_error (high priority) or lua_error_by_file. When lua_code_cache is on the script will cache with it's absolute path.
syntax: lua_access <lua-script-str>
default: nil
context: location
phase: access
Each script must return true or false. When there is a syntax error or any other error with script it will pass to lua_error (high priority) or lua_error_by_file.
syntax: lua_access_by_file <path-to-lua-script-file>
default: nil
context: location
phase: access
Each script must return true or false. When there is a syntax error or any other error with script it will pass to lua_error (high priority) or lua_error_by_file. When lua_code_cache is on the script will cache with it's absolute path.
syntax: lua_error <lua-script-str>
default: nil
context: main
phase: on error
When there is a syntax error or any other error with script it will write the log and return nothing for client.
syntax: lua_error_by_file <path-to-lua-script-file>
default: nil
context: main
phase: on error
When there is a syntax error or any other error it will write the log and return nothing for client. When lua_code_cache is on the script will cache with it's absolute path.
syntax: lua_exit <lua-script-str>
default: nil
context: main
phase: exit process
syntax: lua_exit_by_file <path-to-lua-script-file>
default: nil
context: main
phase: exit process
syntax: ngx.req.args
context: lua_content*, lua_access*, lua_error*
Table for request arguments.
syntax: ngx.err.msg
context: lua_error*
Error message.
syntax: ngx.err.stat
context: lua_error*
Signed with error number with process always 404 or 500.
syntax: ngx.log(log_level, ...)
context: lua_content*, lua_access*, lua_error*
The log_level from log_level.
syntax: ngx.var.VAR_NAME
context: lua_content*, lua_access*, lua_error*
VARIABLE for nginx.
syntax: ngx.scp.path
context: lua_init_by_file, lua_content_by_file, lua_access_by_file, lua_error_by_file, lua_exit_by_file
Script realpath for current context.
syntax: ngx.__req__
context: lua_content*, lua_access* lua_error*
ngx_http_request_t structure.