This is a nice example: http://stackoverflow.com/questions/22788236/how-can-i-manipulate-the-json-body-of-a-post-request-using-nginx-and-lua
However I need to edit a POST eventbody on a binary level, the body contains xml code and some binary data which needs to be changed, for now I'm using a perl intercept script between the proxypass output and a tomcat backend but I'd like to do this with Lua, any ideas ?