Open
Description
Ⅰ. Issue Description
使用 Lua 模块的 ngx.location.capture api 时报错 504
Ⅱ. Describe what happened
Ⅲ. Describe what you expected to happen
Ⅳ. How to reproduce it (as minimally and precisely as possible)
- 编译条件
./configure --prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--with-ld-opt='-Wl,-rpath,/usr/local/luajit/lib,--as-needed -pie' \
--add-module=modules/ngx_http_lua_module \
--with-debug --with-cc-opt='-g -O0'
- nginx 配置
location /test {
content_by_lua_block {
local res = ngx.location.capture("/backend", { method = ngx.HTTP_GET, body = "" })
if res.status == 200 then
ngx.say("Backend response: ", res.body)
else
ngx.status = res.status
ngx.say("Error: ", res.status)
end
}
}
location /backend {
proxy_pass http://127.0.0.1:8080;
}
- curl 测试
curl http://localhost/test
Error: 504
Ⅴ. Anything else we need to know?
Ⅵ. Environment:
- Tengine version (use
sbin/nginx -V
):
Tengine version: Tengine/3.1.0
nginx version: nginx/1.24.0
built by gcc 12.2.0 (Debian 12.2.0-14)
built with OpenSSL 3.0.15 3 Sep 2024
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --with-ld-opt='-Wl,-rpath,/usr/local/luajit/lib,--as-needed -pie' --add-module=modules/ngx_http_lua_module --with-debug --with-cc-opt='-g -O0' - OS (e.g. from /etc/os-release):
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm - Kernel (e.g.
uname -a
): - Others:
Metadata
Metadata
Assignees
Labels
No labels