You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
location /test_block {
content_by_lua '
res = ngx.location.capture("/v1/tfs/T17yCTByJT1RCvBVdK")
if res.status == ngx.HTTP_OK then
ngx.print(res.body)
else
ngx.exit(res.status)
end
';
}
类似的问题:
http://code.taobao.org/p/tfs/issue/1312/
相关信息:
系统信息
$ uname -a
Linux tfs004 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
ngx_openresty 版本
$ ./nginx -V
nginx version: ngx_openresty/1.2.7.1
built by gcc 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)
TLS SNI support enabled
configure arguments: --prefix=/home/server/openresty-debug/nginx --with-debug --with-cc-opt=-O0 --add-module=../ngx_devel_kit-0.2.18 --add-module=../iconv-nginx-module-0.10rc7 --add-module=../echo-nginx-module-0.42 --add-module=../xss-nginx-module-0.03rc9 --add-module=../ngx_coolkit-0.2rc1 --add-module=../set-misc-nginx-module-0.22rc8 --add-module=../form-input-nginx-module-0.07 --add-module=../encrypted-session-nginx-module-0.02 --add-module=../ngx_postgres-1.0rc2 --add-module=../srcache-nginx-module-0.19 --add-module=../ngx_lua-0.7.16 --add-module=../headers-more-nginx-module-0.19 --add-module=../array-var-nginx-module-0.03rc1 --add-module=../memc-nginx-module-0.13rc3 --add-module=../redis2-nginx-module-0.09 --add-module=../redis-nginx-module-0.3.6 --add-module=../auth-request-nginx-module-0.2 --add-module=../rds-json-nginx-module-0.12rc10 --add-module=../rds-csv-nginx-module-0.05rc2 --with-ld-opt=-Wl,-rpath,/home/server/openresty-debug/luajit/lib --with-http_ssl_module --with-http_stub_status_module --add-module=/home/makerpm/git/nginx-auth-ldap --add-module=/home/makerpm/git/nginx_upstream_hash --add-module=/home/makerpm/git/ngx_http_substitutions_filter_module --add-module=/home/makerpm/git/nginx-tfs
nginx-tfs 模块最新的 commit
$ git log -1
commit d1c8349
Merge: dcb7507 83d9a33
Author: Zheng Cen [email protected]
Date: Thu Jan 17 03:03:57 2013 -0800
重现问题的步骤
(1) 使用下面的 nginx.conf 启动 nginx
nginx.conf: https://gist.github.com/harveyzh/5055847#file-nginx-conf
(2) ngx.location.capture 指令直接调用 nginx-tfs 模块会一直 block
测试命令:
$ curl -i 127.0.0.1/test_block
^C
相关配置片段:
debug log: https://gist.github.com/harveyzh/5055847#file-error-log-block
block时的 debug log 停在
2013/02/28 18:41:06 [debug] 29836#0: *6 http copy filter: 0 "/v1/tfs/T17yCTByJT1RCvBVdK?"
2013/02/28 18:41:06 [debug] 29836#0: *6 http finalize request: 0, "/v1/tfs/T17yCTByJT1RCvBVdK?" a:0, c:2
2013/02/28 18:41:06 [debug] 29836#0: *6 lua run post subrequest handler, rc:0 c:2
2013/02/28 18:41:06 [debug] 29836#0: *6 lua restoring write event handler
2013/02/28 18:41:06 [debug] 29836#0: *6 http wake parent request: "/test_block?"
2013/02/28 18:41:06 [debug] 29836#0: keepalive dummy handler
2013/02/28 18:41:06 [debug] 29836#0: timer delta: 1
2013/02/28 18:41:06 [debug] 29836#0: posted events 0000000000000000
2013/02/28 18:41:06 [debug] 29836#0: worker cycle
2013/02/28 18:41:06 [debug] 29836#0: epoll timer: -1
(3) ngx.location.capture 指令间接通过 proxy_pass 调用 nginx-tfs 模块则 ok
测试命令:
$ curl -i 127.0.0.1/test_ok
HTTP/1.1 200 OK
Server: ngx_openresty
Date: Thu, 28 Feb 2013 10:59:44 GMT
Content-Type: application/octet-stream
Transfer-Encoding: chunked
Connection: keep-alive
test!
相关配置片段:
debug log: https://gist.github.com/harveyzh/5055847#file-error-log-ok
The text was updated successfully, but these errors were encountered: