一 子查询
在一个'location'中对'另外一个'location做'一次请求','表面'看起来是一个HTTP请求,实际不是
关键字: 'capture'
说明: 后续以一个'案例'进行讲解
最佳实践: 暴露给'前台'的只有一个'API接口',每个'location'只做一个特定的'功能'
location /lua {
content_by_lua '
local res = ngx.location.capture("/some_other_location")
if res.status == 200 then
ngx.print(res.body)
end';
}
++++++++'并行子查询'++++++&