NGINX Header and Body Filter Modules
I note that Evan doesnt fix http content length in ngx_http_<module_name>_header_filter()
.
If I dont add http content length(r->headers_out.content_length_n
), the inserted text to the end of request will not be output from nginx-1.2.7 stable.
Also you can see footer filter module.