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

Wendal Chen wendal1985 at
Tue Mar 15 10:26:59 MSK 2011


Lua-nginx-module 0.16RC2
Nginx  0.8.54

my nginx.conf :
        location =/down2 {
                content_by_lua_file "conf/lua_test.lua";

and lua_test.lua:
local res = ngx.location.capture('/somepath')
-- do something for res

ngx.exec("/down/pathXXX")  -- File content is "ABC"

then , If I use command:
curl localhost/down2
#print out ABC

if I use Firefox to visit URL "http://localhost/down/pathXXX" and then "ABC"
show out.

BUT , if I use ab to test it :
ab -v http://localhost/down2
#Fail with timeout

Log of ab:

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: 10
Last-Modified: Fri, 11 Mar 2011 09:32:28 GMT
Connection: close
Accept-Ranges: bytes

I am Best

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

I think lua-nginx-module lose some 0x0A 0x0D in resp.

Wendal Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list