RE: Subrequests and output filters

2015-08-07 Thread Maxime Henrion
Thanks for the answer. I have tried using the NGX_HTTP_SUBREQUEST_IN_MEMORY flag and a post subrequest callback; in fact the code I copy-pasted uses those. However, I don't see how to get at the response's body from this callback. Looking at the SSI module code, the ngx_http_ssi_stub_output() p

Re: Subrequests and output filters

2015-08-07 Thread Maxim Dounin
Hello! On Fri, Aug 07, 2015 at 11:33:06AM +, Maxime Henrion wrote: > Thanks for the answer. > > I have tried using the NGX_HTTP_SUBREQUEST_IN_MEMORY flag and a > post subrequest callback; in fact the code I copy-pasted uses > those. However, I don't see how to get at the response's body >

RE: Subrequests and output filters

2015-08-07 Thread Maxime Henrion
Thanks, I see I should be using r->upstream->buffer now. However this callback never seems to be called into for me... I have some heavy log messages there that don't show. I can tell that the response was read however, as if I send random garbage nginx complains about the response not having th

Re: [PATCH] Set Content-Length to 0 when proxying requests with discarded body

2015-08-07 Thread Roman Arutyunyan
Hello Daniil, > On 29 Jul 2015, at 16:28, Bondarev, Daniil wrote: > > Hello, > > We have a use case where we need to discard request body before proxying > request to the upstream. To do this we call ngx_http_discard_request_body, > but it uses r->headers_in.content_length_n to store the amount

Re: Subrequests and output filters

2015-08-07 Thread Maxim Dounin
Hello! On Fri, Aug 07, 2015 at 06:22:25PM +, Maxime Henrion wrote: > Thanks, I see I should be using r->upstream->buffer now. However > this callback never seems to be called into for me... I have > some heavy log messages there that don't show. I can tell that > the response was read howe