已经搞定,把所有 say 都换成print了
在 2012年12月8日星期六UTC+8上午9时44分42秒,kindy写道:
木有问题,测试是符合预期的。问题是,你觉得有什么问题嘛?
2012/12/7 zhan hu
<stone...@gmail.com>
确实如此啊,看我这个测试有问题吗?
[root@centos2 conf]# cat test.lua
ngx.say("hello world")
[root@centos2 conf]# cat test1.lua
local res = ngx.location.capture("/test")
ngx.say(res.body)
location /test{
content_by_lua_file 'conf/test.lua';
}
location /test1{
content_by_lua_file 'conf/test1.lua';
}
测试结果:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 12 0 12 0 0 923 0 --:--:-- --:--:-- --:--:-- 2000
HTTP/1.1 200 OK^M$
Server: nginx/1.2.3^M$
Date: Fri, 07 Dec 2012 09:41:49 GMT^M$
Content-Type: application/octet-stream^M$
Transfer-Encoding: chunked^M$
Connection: keep-alive^M$
^M$
hello world$
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 13 0 13 0 0 924 0 --:--:-- --:--:-- --:--:-- 2166
HTTP/1.1 200 OK^M$
Server: nginx/1.2.3^M$
Date: Fri, 07 Dec 2012 09:41:53 GMT^M$
Content-Type: application/octet-stream^M$
Transfer-Encoding: chunked^M$
Connection: keep-alive^M$
^M$
hello world$
$
[root@HZ5 conf]#
在 2012年12月7日星期五UTC+8下午5时24分23秒,
zhan hu写道:
碰到一个问题,最近有个业务吧原来多个请求输出合并,发现通过 ngx.location.capture 返回的res.body会在后面多加一个“\n” ;请问这个是什么bug?
--
- - - - - - - - - - - -
林青(Kindy Lin)