passing NULL to body filter is ok. if NULL passed to the last body filter(ngx_http_write_filter) and all buffers in chain has been sent ngx_http_next_body_filter will return NGX_OK