1.子查询是什么
location /lua {
content_by_lua '
local res = ngx.location.capture("/some_other_location")
if res.status == 200 then
ngx.print(res.body)
end';
}
2.并行子查询
res1, res2, res3 = ngx.location.capture_multi{
{"/foo", {args = "a=3&b=4" }},
{"/bar" },
{"/baz", {method = ngx.HTTP_POST, body = "hello"}}
}