-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttplite_http_module.c
More file actions
93 lines (83 loc) · 3.01 KB
/
httplite_http_module.c
File metadata and controls
93 lines (83 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include <nginx.h>
#include <ngx_core.h>
#include <ngx_config.h>
#include "httplite_module_configuration.h"
#include "httplite_http_module_configuration.h"
#include "httplite_upstream_module_configuration.h"
#include "httplite_http_module.h"
ngx_command_t httplite_http_commands[] = {
{
ngx_string("server"),
HTTPLITE_MAIN_CONFIGURATION | NGX_CONF_BLOCK | NGX_CONF_NOARGS,
httplite_core_server,
HTTPLITE_MAIN_CONFIGURATION_OFFSET,
0,
NULL
},
{
ngx_string("listen"),
HTTPLITE_SERVER_CONFIGURATION | NGX_CONF_TAKE1,
ngx_conf_set_num_slot,
HTTPLITE_SERVER_CONFIGURATION_OFFSET,
offsetof(httplite_server_conf_t, port),
NULL
},
{
ngx_string("server_name"),
HTTPLITE_SERVER_CONFIGURATION | NGX_CONF_TAKE1,
ngx_conf_set_str_slot,
HTTPLITE_SERVER_CONFIGURATION_OFFSET,
offsetof(httplite_server_conf_t, server_name),
NULL
},
{
ngx_string("upstreams"),
HTTPLITE_MAIN_CONFIGURATION | NGX_CONF_BLOCK | NGX_CONF_NOARGS,
httplite_core_upstream,
HTTPLITE_MAIN_CONFIGURATION_OFFSET,
0,
NULL
},
{
ngx_string("server"),
HTTPLITE_UPSTREAM_CONFIGURATION | NGX_CONF_1MORE,
httplite_parse_upstream_server,
HTTPLITE_UPSTREAM_CONFIGURATION_OFFSET,
0,
NULL
},
{
ngx_string("keep_alive"),
HTTPLITE_UPSTREAM_CONFIGURATION | NGX_CONF_1MORE,
ngx_conf_set_num_slot,
HTTPLITE_UPSTREAM_CONFIGURATION_OFFSET,
offsetof(httplite_upstream_configuration_t, keep_alive),
NULL
},
ngx_null_command
};
httplite_module_t httplite_http_module_context = {
NULL, /* preconfiguration */
httplite_http_block_initialization, /* postconfiguration */
httplite_http_block_create_main_configuration, /* create main configuration */
NULL, /* init main configuration */
httplite_core_create_server_configuration, /* create server configuration */
NULL, /* merge server configuration */
httplite_create_upstream_configuration, /* create upstream configuration */
NULL, /* merge location configuration */
};
/* options for the module */
ngx_module_t httplite_http_module = {
NGX_MODULE_V1,
&httplite_http_module_context, /* module context */
httplite_http_commands, /* module directives */
HTTPLITE_MODULE, /* module type */
NULL, /* init master */
NULL, /* init module */
NULL, /* init process */
NULL, /* init thread */
NULL, /* exit thread */
NULL, /* exit process */
NULL, /* exit master */
NGX_MODULE_V1_PADDING
};