【发布时间】:2018-02-12 09:35:57
【问题描述】:
我有一个出租位置,我想在其中注册一个具有特定值的变量aet。
location /aet {
default_type 'text/plain';
content_by_lua '
if ngx.var.host:match("(.*).nexus$") ~= nil then
aet = ngx.var.host:match("(.-)%.")
ngx.say(aet)
end
';
}
我想在另一个出租位置使用这个变量/getIp`
location /getIp {
default_type 'application/json';
rds_json on;
content_by_lua '
postgres_pass database;
postgres_query "SELECT ip FROM establishment_view WHERE aet = aet";
postgres_output rds;
';
}
我希望变量aet 初始化而不需要调用路径/ aet
【问题讨论】: