Welcome! Log In Create A New Profile

Advanced

Re: Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec

All files from this thread

File Name File Size   Posted by Date  
96 bytes open | download Wendal Chen 03/17/2011 Read message
Wendal Chen
March 15, 2011 07:48AM
nginx.conf

location /test {
root html;
content_by_lua_file "conf/test.lua";
}

test.lua:
-- start
ngx.location.capture('/1.html')

ngx.exec("/1.html")
-- end

Files in folder :

nginx
-- conf
-- nginx.conf
-- test.lua
-- html
-- 1.html

That is all

#用中文再说一遍,英语水平有限:
我得到的最小集合就是:
1. nginx.conf
location /test {
root html;
content_by_lua_file "conf/test.lua";
}
server/http等配置按默认的, event module用的是 epoll

2. test.lua文件仅2行:
ngx.location.capture('/1.html')

ngx.exec("/1.html")

我尝试过,无论这两句话是否请求同一个文件,结果都一样.

3. 1.html文件里面仅有几个字母,我已经试过不同的文件大小,结果一样


我遇到的情况是这样的:
1. 通过wget/curl/Firefox来访问 localhost/test 都能正常显示1.html中的内容
2. 使用ab访问 localhost/1.html是正常的,能够pass
3. 使用ab进行测试,总是timeout , 我使用的语句是 ab -v 5 localhost/test
Benchmarking localhost (be patient)...INFO: POST header ==
---
GET /down2 HTTP/1.0
Host: localhost
User-Agent: ApacheBench/2.3
Accept: */*


---
LOG: header received:
HTTP/1.1 200 OK
Server: nginx/0.8.54
Date: Tue, 15 Mar 2011 07:22:30 GMT
Content-Type: text/plain
Content-Length: 4
Last-Modified: Fri, 11 Mar 2011 09:32:28 GMT
Connection: close
Accept-Ranges: bytes

ABC

LOG: Response code = 200
apr_poll: The timeout specified has expired (70007)

其中的ABC就是1.html的内容, 非常抱歉我之前写错了.

对于0A0D的描述,仅仅是我的猜测,请无视之.

单独写 ngx.exec("/1.html") 也是能够通过ab测试的.

环境:
Ubuntu 10.10
Luajit-5.1-dev
Nginx 0.8.54
Lua-nginx-module 0.16rc2

Thanks,
Wendal Chen

2011/3/15 agentzh <agentzh@gmail.com>

> On Tue, Mar 15, 2011 at 3:26 PM, Wendal Chen <wendal1985@gmail.com> wrote:
> > Hi,
> >
> > Lua-nginx-module 0.16RC2
> > Nginx 0.8.54
> >
> [snip]
> >
> > I am Best
> >
> > LOG: Response code = 200
> > apr_poll: The timeout specified has expired (70007)
> >
>
> Can you provide a minimized but complete example to help us reproduce
> this issue?
>
> I do not understand where the output "I am Best" came from in your
> sample, for example.
>
> And in particular, what exactly were you doing in "-- do something for res"
> ?
>
> > I think lua-nginx-module lose some 0x0A 0x0D in resp.
> >
>
> Where does "0x0A 0x0D" come from?
>
> Cheers,
> -agentzh
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec

Wendal Chen March 15, 2011 03:30AM

Re: Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec

agentzh March 15, 2011 06:42AM

Re: Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec

Wendal Chen March 15, 2011 07:48AM

Re: Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec

agentzh March 17, 2011 02:48AM

Re: Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec Attachments

Wendal Chen March 17, 2011 07:46AM

Re: Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec

agentzh April 06, 2011 11:16PM

Re: Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec

Wendal Chen April 07, 2011 03:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready