-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
Copy pathcustom_nginx.template
96 lines (76 loc) · 2.01 KB
/
custom_nginx.template
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
94
95
96
# This is a custom nginx configuration template for Kong specs
pid pids/nginx.pid; # mandatory even for custom config templates
> if wasm and wasm_dynamic_module then
load_module $(wasm_dynamic_module);
> end
error_log ${{PROXY_ERROR_LOG}} ${{LOG_LEVEL}};
# injected nginx_main_* directives
> for _, el in ipairs(nginx_main_directives) do
$(el.name) $(el.value);
> end
> if database == "off" then
lmdb_environment_path ${{LMDB_ENVIRONMENT_PATH}};
lmdb_map_size ${{LMDB_MAP_SIZE}};
> if lmdb_validation_tag then
lmdb_validation_tag $(lmdb_validation_tag);
> end
> end
events {
# injected nginx_events_* directives
> for _, el in ipairs(nginx_events_directives) do
$(el.name) $(el.value);
> end
}
> if wasm then
wasm {
> for _, el in ipairs(nginx_wasm_main_shm_kv_directives) do
shm_kv $(el.name) $(el.value);
> end
> for _, module in ipairs(wasm_modules_parsed) do
module $(module.name) $(module.path);
> end
> for _, el in ipairs(nginx_wasm_main_directives) do
> if el.name == "shm_kv" then
shm_kv * $(el.value);
> else
$(el.name) $(el.value);
> end
> end
> if #nginx_wasm_wasmtime_directives > 0 or wasmtime_cache_config_file then
wasmtime {
> if wasmtime_cache_config_file then
cache_config $(quote(wasmtime_cache_config_file));
> end
> for _, el in ipairs(nginx_wasm_wasmtime_directives) do
flag $(el.name) $(el.value);
> end
}
> end -- wasmtime
> if #nginx_wasm_v8_directives > 0 then
v8 {
> for _, el in ipairs(nginx_wasm_v8_directives) do
flag $(el.name) $(el.value);
> end
}
> end -- v8
> if #nginx_wasm_wasmer_directives > 0 then
wasmer {
> for _, el in ipairs(nginx_wasm_wasmer_directives) do
flag $(el.name) $(el.value);
> end
}
> end -- wasmer
}
> end
> if role == "control_plane" or #proxy_listeners > 0 or #admin_listeners > 0 or #status_listeners > 0 then
http {
include 'nginx-kong.conf';
include '*http.test.conf';
}
> end
> if #stream_listeners > 0 or cluster_ssl_tunnel then
stream {
include 'nginx-kong-stream.conf';
include '*stream.test.conf';
}
> end