Subrequests and output filters

Maxim Dounin mdounin at
Fri Aug 7 18:00:39 UTC 2015


On Fri, Aug 07, 2015 at 11:33:06AM +0000, 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 
> from this callback. Looking at the SSI module code, the 
> ngx_http_ssi_stub_output() post subrequest callback does some 
> consistency checks, sets the headers if they haven't been set 
> already, and then just calls into ngx_http_output_filter() with 
> a buffer chain that was actually passed to it through the "data" 
> field of the post subrequest handler structure.
> I'm obviously missing things here, but I don't understand how to 
> get at that response's body still.

Function to look for is ngx_http_ssi_set_variable().

Maxim Dounin

More information about the nginx-devel mailing list