Brian Bruns brian.bruns at
Wed Oct 15 07:08:57 MSD 2008

Hi Valery,

First, thanks for all your help, I'm slowing getting a handle on the
internal workings of nginx but it's been a bit of a learning curve.

I did some more digging and what I'm finding is that everything is
indeed working correctly except the connection is not closed after the
results are returned.  Here is the transaction with my module in the


POST /hello HTTP/1.0
Content-Length: 10



HTTP/1.1 200 OK
Server: nginx/0.7.19
Date: Wed, 15 Oct 2008 03:02:41 GMT
Content-Type: text/plain
Content-Length: 11
Last-Modified: Mon, 28 Sep 1970 06:00:00 GMT
Connection: close

hello world

The connection then hangs until another character is sent from the
client to the server at which time it closes.

I've replicated the same request using fastcgi/perl and it works flawlessly.

Any thoughts on why my module would require additional input from the
client to close the connection?

Thanks again,


2008/10/9 Valery Kholodkov <valery+nginxen at>:
>> What I want to do is "return ngx_http_output_filter(r, &out);" just
>> like before, but that seems to not work, my question is should it work
>> from the request_body_handler and is there any special trick to doing
>> so or better yet an existing module I can look at for pointers? I
>> couldn't find one, virtually everything that uses
>> ngx_http_read_client_request_body is an upstream module.
> I don't know whether a module doing similar thing exists, but I assume you
> invoke ngx_http_send_header, interpret the result, call
> ngx_http_output_filter and it should be ok.
> --
> Best regards,
> Valery Kholodkov

More information about the nginx mailing list