Like the title says, I'm curious if it would be possible to somehow read the POST body before the server block (either with a module or with some nginx setting).
I'm using the ngx_http_geoip2_module and sometimes the IPs that I need to parse are being passed to me in a POST body and I'm unable to access the POST body in the http block (which is the only place where I can make use of the geoip2 module). I also use the njs module and I tried to do a workaround by making a subrequest with GET variables to see if I can get it to work that way. The result was that even though nginx seems to be able to register the url parameters in the http block with this method the module still doesn't register the new variables and it doesn't change its output. This ultimately forces me to make a proxy_pass request to the same server with GET url parameters in order to parse the data. For performance reasons I would prefer not to use the proxy_pass approach and I would much more prefer it if I could somehow force the body to be read early on and to parse the parameters from the POST body via njs in the http block.
I'm using Nginx 1.21.3 and njs 0.6.2.
If anyone has any solutions or tips to help with this I'd appreciate it.