Hey,
i'm having issues trying to proxy POST requests with ngx_lua.
I'm using https://github.com/pintsized/lua-resty-http to run the actual requests to upstream.
The problem is with request body reading.
The default (and afaik most efficient) way to do this is to use the lua-resty-http function. But this doesn't work when under an HTTPS SPDY connection, because it uses to read the request body (which doesn't work under SPDY).
So in that case we can fall back to using , but now we face an issue when POST data size exceeds , and the response data is now buffered into temporary files and this method returns .
So then you can then call to get the temporary file name, which it does return. However, trying to read the file gives an error like this:
error while opening file: /usr/local/openresty/nginx/client_body_temp/0000000100: No such file or directory
Which makes no sense, considering that did return this file path, which means it is actually used. It probably gets deleted before you can try to access it.
One workaround is to set to "on" or "clean" in nginx config, in which case you can actually read that file and forward the request body stored in it. But i fear this may have performance implications, since afaik all POST requests bodies (even small ones) will now be buffered to disk.
Is anyone aware of these issues, and if so - do you know of any stable, recommended way of dealing with POST request bodies?