Welcome! Log In Create A New Profile

Advanced

Modifying Headers by Analyzing Body

February 05, 2019 07:29AM
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
Subject Author Posted

Modifying Headers by Analyzing Body

abmackenzie February 05, 2019 07:29AM

Re: Modifying Headers by Analyzing Body

Roman Arutyunyan February 05, 2019 08:58AM

Re: Modifying Headers by Analyzing Body

abmackenzie February 05, 2019 09:11AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 76
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready