How to modify a POST arg within Nginx?

Maxim Dounin mdounin at mdounin.ru
Mon Apr 28 12:52:12 UTC 2014


Hello!

On Mon, Apr 28, 2014 at 04:59:54AM +0000, Elvis Deng wrote:

> Hi all,
> 
> I want to modify a POST value in Nginx and then put it back (don't change its original data flow).
> Does any existing module do the similar work? Thanks.

For simple use cases, the proxy_set_body directive can be used, 
see http://nginx.org/r/proxy_set_body.

Some 3rd party modules try to read request body themself and/or 
read it and then restart request processing with internal redirect 
or something like, but this is more or less a hack.

An API for a generic request body modifications isn't yet here, 
though there is an experminental patch previously published, 
see here:

http://mailman.nginx.org/pipermail/nginx-devel/2013-March/003492.html

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx-devel mailing list