Welcome! Log In Create A New Profile

Advanced

body filter redirect

July 12, 2021 03:48PM
Hi,
In my module, I am trying to take actions based on the content of the body.
To accomplish this, I am capturing the body using body file as shown in the
example below:

http://mdounin.ru/hg/ngx_http_catch_body_filter_module/file/tip/ngx_http_catch_body_filter_module.c

This is working well. I can inspect the contents of the body and take
different actions like rejecting requests etc. However, one of the actions
I want to do is redirect the request based on the body content i.e if the
content contains some string etc, then redirect the request i.e change the
upstream/location etc. My question is, is it even possible to redirect a
request in the body filter stage? Is there another way to do body
capture/filter and still be able to redirect the request after inspecting
the body? Any help, suggestions or sample code is appreciated. Thanks.

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

body filter redirect

dnj0496 130 July 12, 2021 03:48PM

Re: body filter redirect

Maxim Dounin 18 July 13, 2021 10:50AM

Re: body filter redirect

dnj0496 17 July 14, 2021 12:30AM

Re: body filter redirect

dnj0496 12 July 15, 2021 11:42PM

Re: body filter redirect

Maxim Dounin 13 July 16, 2021 12:52PM



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

Online Users

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