【发布时间】:2021-02-04 11:37:01
【问题描述】:
我想将值分配给 nginx 变量。
这是我的示例代码。
location / {
set $TOKEN;
content_by_lua_block {
result = io.popen("echo 'https://google.com'") # or any command that will return value to result
ngx.var.TOKEN = result:read()
}
proxy_pass ${TOKEN};
有人知道吗?
【问题讨论】:
标签: nginx lua nginx-reverse-proxy nginx-config openresty