nginx_filter_framework
Overview
nginx supports two kinds of filter when sending response to client, one is header filter, the other is body filter, header filter is called before sending response header to client, body filter is called before sending body to client, you can create your own filter module to do anything(mostly related to header manipulation or body manipulation) without break any nginx source code.