Modify request body before sending to upstream

abhinanda nginx-forum at
Tue Jan 27 06:20:54 UTC 2015


I tried ngx_lua but I might've been doing something wrong. It complained
that I am not allowed to use "proxy_pass" following a content rewrite.

To make it even simpler, here's a simplified example:

- curl -X POST --data "ABCD" localhost:8080
- an NGINX module that calls a custom C function to alter the string, say
"a[1]+=5", so now we have "AGCD"
- send "AGBC" to upstream app
- respond with whatever the upstream responds (no filters beyond this)

Posted at Nginx Forum:,256226,256283#msg-256283

More information about the nginx mailing list