Hi all,
I am attempting to develop an NGINX module which is required to modify the response headers based on the content of the response body, whether from an upstream proxy or being fulfilled by the server itself.
My current approach, a body filter, does not seem fruitful. By the time the body filter is invoked the headers have already been sent. There is no way to generate the correct header without the response body. I cannot find any mechanism in the NGX API to postpone sending of the headers or access the response body in a header filter.
I was hoping somebody could either point me in the direction of a solution (or confirm that what I am trying to do is impossible without modification of the NGINX source).
Thanks,
Alex