How to make a subrequest from content handler?

kabirova Kabirova.Nailya at
Thu Feb 26 12:41:28 UTC 2015

How to make a subrequest from content handler?


I have a problem when using subrequest in content handler.

The content handler (my_content_handler) calls 
ngx_http_read_client_request_body with callback handler (my_callback). 
my_callback() makes a subrequest:

ngx_int_t my_content_handler()


     rc = ngx_http_read_client_request_body(r, my_callback);

return rc;


void my_callback()


ps->handler = my_post_subrequest;

ps->data = ctx;

ngx_http_subrequest(r, ..., ps);


void my_post_subrequest()


     /* required to return back to my_content_handler after completion 
of subrequest in order to be able to handle resulting response of 
subrequest */


I have 2 questions:

1. how to return back to my_content_handler, if it invokes a subrequest?

2. how to proxy subrequest's response to client?

Thanks in advance!

Best regards,

Kabirova Nailya.

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

More information about the nginx-devel mailing list