Hi,
I'm developing a filter module which should get a response from upstream server, modify it with an external program and send it to the client. I'm using nginx as a reverse proxy. I need to know how can I get the buffer chain flattened to be sent to an external program and then devide the result into chunks to be sent to the client.
I cannot find a documentation for the nginx chains and don't fully understand how they work.
Here is an example pseudo code (presuming there are no chains and in is the whole upstream response body):
... ngx_http_xxx_body_filter(... r, ... in) {
// execute the external program on body
out = execute_program(in);
// pass the result to the next body filter
ngx_http_next_body_filter(r, out);
}
Edited 2 time(s). Last edit at 12/29/2011 07:21PM by edo888.