全局配置中定义env
events{
...
}
env BPM_SERVICE_HOST;
env BPM_SERVICE_PORT;
service中获取
set_by_lua $bpm_host 'return os.getenv("BPM_SERVICE_HOST")';
set_by_lua $bpm_port 'return os.getenv("BPM_SERVICE_PORT")';
lua中使用
local host=ngx.var.bpm_host
events{
...
}
env BPM_SERVICE_HOST;
env BPM_SERVICE_PORT;
set_by_lua $bpm_host 'return os.getenv("BPM_SERVICE_HOST")';
set_by_lua $bpm_port 'return os.getenv("BPM_SERVICE_PORT")';
local host=ngx.var.bpm_host
上一篇: vue中使用mockjs模拟接口数据
下一篇: mock模拟增删改查操作