Maybe you can use perl if you don’t like php or lua.
http://nginx.org/en/docs/http/ngx_http_perl_module.html#methods
$r->has_request_body(handler)
But out of the box nginx isn’t the tool to save a received post request and store it.
Maybe uWSGI ( https://uwsgi-docs.readthedocs.io/en/latest/ ) is a better way to go with http-socket https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html and a python app.