1
/* vim:set ft=c ts=4 sw=4 et fdm=marker: */
2
#include "ngx_http_lua_directive.h"
3
#include "ngx_http_lua_conf.h"
4
#include "ngx_http_lua_filter.h"
7
static ngx_command_t ngx_http_lua_cmds[] = {
9
ngx_string("lua_package_cpath"),
10
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE1,
11
ngx_http_lua_package_cpath,
12
NGX_HTTP_MAIN_CONF_OFFSET,
18
ngx_string("lua_package_path"),
19
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE1,
20
ngx_http_lua_package_path,
21
NGX_HTTP_MAIN_CONF_OFFSET,
27
ngx_string("lua_need_request_body"),
28
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF |
30
ngx_conf_set_flag_slot,
31
NGX_HTTP_LOC_CONF_OFFSET,
32
offsetof(ngx_http_lua_loc_conf_t, force_read_body),
36
/* set_by_lua $res <inline script> [$arg1 [$arg2 [...]]] */
38
ngx_string("set_by_lua"),
39
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_SIF_CONF |
40
NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_2MORE,
41
ngx_http_lua_set_by_lua,
42
NGX_HTTP_LOC_CONF_OFFSET,
44
ngx_http_lua_filter_set_by_lua_inline
47
/* set_by_lua_file $res rel/or/abs/path/to/script [$arg1 [$arg2 [..]]] */
49
ngx_string("set_by_lua_file"),
50
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_SIF_CONF |
51
NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_2MORE,
52
ngx_http_lua_set_by_lua,
53
NGX_HTTP_LOC_CONF_OFFSET,
55
ngx_http_lua_filter_set_by_lua_file
58
/* content_by_lua <inline script> */
60
ngx_string("content_by_lua"),
61
NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
62
ngx_http_lua_content_by_lua,
63
NGX_HTTP_LOC_CONF_OFFSET,
65
ngx_http_lua_content_handler_inline
68
/* content_by_lua_file rel/or/abs/path/to/script */
70
ngx_string("content_by_lua_file"),
71
NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
72
ngx_http_lua_content_by_lua,
73
NGX_HTTP_LOC_CONF_OFFSET,
75
ngx_http_lua_content_handler_file
81
ngx_http_module_t ngx_http_lua_module_ctx = {
82
NULL, /* preconfiguration */
83
ngx_http_lua_filter_init, /* postconfiguration */
85
ngx_http_lua_create_main_conf, /* create main configuration */
86
ngx_http_lua_init_main_conf, /* init main configuration */
88
NULL, /* create server configuration */
89
NULL, /* merge server configuration */
91
ngx_http_lua_create_loc_conf, /* create location configuration */
92
ngx_http_lua_merge_loc_conf /* merge location configuration */
95
ngx_module_t ngx_http_lua_module = {
97
&ngx_http_lua_module_ctx, /* module context */
98
ngx_http_lua_cmds, /* module directives */
99
NGX_HTTP_MODULE, /* module type */
100
NULL, /* init master */
101
NULL, /* init module */
102
NULL, /* init process */
103
NULL, /* init thread */
104
NULL, /* exit thread */
105
NULL, /* exit process */
106
NULL, /* exit master */
107
NGX_MODULE_V1_PADDING