各位,有这样的配置如下:
location /abc {
rewrite_by_lua_file abc.lua;
proxy_pass http:
其中abc.lua中调用了ngx.location.capture进行了自请求跳转,大概代码如下:
ngx.log(ngx.ERR,"hello,start subrequest")
ngx.req.read_body()
local body_data = ngx.req.get_body_data()
res=ngx.location.capture("/internal",{ share_all_vars = true , always_forward_body = true, args = ngx.req.get_uri_args() })
ngx.log(ngx.ERR,"hello,resutl is:",res.status)
在多数情况下,都正常工作。
但是有可观数量的情况存在这样的问题
看log日志,打印了ngx.log(ngx.ERR,"hello,start subrequest"),但是没有打印 ngx.log(ngx.ERR,"hello,resutl is:",res.status)。
而且看access日志,发现http返回了000代码,且超时情况特别大(大概耗时100多秒)。
所以问题就是:是否是在自请求的时候被卡住了,还是在自请求里面转发到http://yyy的时候被卡住了?
各位有没有什么办法定位下这个问题呢?感觉和ngx.location.capture的关系有点大,但是不清楚这个api的具体含义。