NGINX: Remove inline Lua from template. (#11806)
This commit is contained in:
parent
ee61440780
commit
6510535ae0
30 changed files with 361 additions and 233 deletions
15
rootfs/etc/nginx/lua/ngx_conf_init_worker.lua
Normal file
15
rootfs/etc/nginx/lua/ngx_conf_init_worker.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
local cjson = require("cjson.safe")
|
||||
|
||||
local f = io.open("/etc/nginx/lua/cfg.json", "r")
|
||||
local content = f:read("*a")
|
||||
f:close()
|
||||
local configfile = cjson.decode(content)
|
||||
|
||||
local lua_ingress = require("lua_ingress")
|
||||
local balancer = require("balancer")
|
||||
local monitor = require("monitor")
|
||||
lua_ingress.init_worker()
|
||||
balancer.init_worker()
|
||||
if configfile.enable_metrics and configfile.monitor_batch_max_size then
|
||||
monitor.init_worker(configfile.monitor_batch_max_size)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue