Brian Bruns brian.bruns at
Thu Oct 9 18:14:57 MSD 2008

Hi Valery,

Basically, I am returning some JSON objects as the text/plain mime type.

This had been working fine (creating the out buffer, etc...) as long
as I did it in the main handler, but it doesn't seem to work quite
right in the request_body_handler.  The client hangs on the response,
if I kill the nginx server, the client returns with the data, but
obviously that's not what I'm looking for.  I would like for the
output to be passed through the filter chain for gzipping and such.

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.



2008/10/8 Valery Kholodkov <valery+nginxen at>:
>> Most examples of using ngx_http_read_client_request_body seem to be
>> upstream modules which really doesn't apply to my situation.  The DAV
>> module does this at the end of the post_handler
>> (ngx_http_dav_put_handler):
>>     ngx_http_finalize_request(r, ngx_http_send_header(r));
>>     return;
>> What is the correct thing to do at the end of the handler?  I've tried
>> both methods and neither seems to have any positive results.
> What result do you actually want to accomplish?
> --
> Best regards,
> Valery Kholodkov

More information about the nginx mailing list