我在使用ngx.location.capture做内部请求的时候,发现没有执行请求地址的Lua脚本。
location /evaluate-one {
access_by_lua_file /home/michael/git/wesker/wesker-nginx/http/evaluate/evaluate-one.lua;
proxy_pass http://mathematica;
}
location /evaluate {
content_by_lua '
for i,v in ipairs(inputs) do
local res = ngx.location.capture('/evaluate-one', {method = ngx.HTTP_POST});
-- do something on res.
end
';
}
我想通过/evaluate 发送内部请求到/evaluate-one,根据返回码做下一步判断。但是/evaluate-one地址的 access_by_lua_file 没有被执行,直接就到下游服务器了。
问一下capture会运行目标地址access的lua脚本吗?