使用 ngx.location.capture() 从使用 proxy_pass、cache 和 aio 的位置获取响应时,缺少响应体
作者: ram-nadella创建于 2015年10月28日更新于 2026年2月12日
我有一个设置,其中请求被捕获在一个具有 content_by_lua_file 指令的位置。这里的 lua 代码包含一些前处理和后处理,但重要的一点是,它使用 ngx.location.capture 向另一个 nginx 位置发出请求。这个位置通过 proxy_pass 和 cache 进行设置。我想测量最近添加到 nginx 核心的 专用 io 线程功能 的影响,因此重新编译了 openresty(1.9.3.1),并向 configure 脚本传递 --with-threads 和 --with-file-aio 标志,在重新编译和 nginx 重启后,在处理代理和缓存的第二个位置中添加了 aio threads; 指令。
内容来源: openresty/lua-nginx-module