Welcome! Log In Create A New Profile

Advanced

Re: Send headers in output body filter ?

Alfred Sawaya
March 26, 2021 10:40PM
Hello again,


Thank you very much Maxim!

It works perfectly.


Alfred


On 27/03/2021 02:48, Maxim Dounin wrote:
> Hello!
>
> On Sat, Mar 27, 2021 at 12:56:16AM +0100, Alfred Sawaya wrote:
>
>> Actually, I will need to modify the http status code depending on the
>> output body contents, so it is not just a question of  content-length,
>> it is more general than that : I need to have the full backend response
>> (headers + body) in order to produce the full client response.
>>
>>
>> It does not seem possible as I understand that the read upstream - write
>> downstream loop is hardcoded into nginx, and a module does not have any
>> chance to change that, isn't it ?
> If you want to change the response status and headers based on the
> response body content, the only way is to buffer the response body
> and send the response headers after you've done processsing the
> response body. Note that since this implies buffering, this is
> not going to work for large responses.
>
> Examples of how to implement this can be seen in the image filter
> and xslt filter modules.
>

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Send headers in output body filter ?

Alfred Sawaya 66 March 26, 2021 01:06PM

Re: Send headers in output body filter ?

Maxim Dounin 12 March 26, 2021 03:04PM

Re: Send headers in output body filter ?

Alfred Sawaya 12 March 26, 2021 04:06PM

Re: Send headers in output body filter ?

Alfred Sawaya 14 March 26, 2021 07:58PM

Re: Send headers in output body filter ?

Maxim Dounin 19 March 26, 2021 09:50PM

Re: Send headers in output body filter ?

Alfred Sawaya 21 March 26, 2021 10:40PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 50
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