Nginx is used to handle uploading of files in a server (he have registered an action of writting a file, when sent to specific endpoint). There is a master process, responsible for various things, including access states and cookie-like values. From other processes, we use gRPC to communicate with the master process. Right now there is no connection between nginx and this process (so files can be upload whenever we want). Our goal is to make nginx communicate with master process, to find out if the file upload is permitted and also if the request carries this cookie-like value.
Is something like this possible? Can this be done by a new module, that parses the request's body and then communicates with master process via gRPC, to get what it needs? Also, in this case, we need also to take into consideration any timeouts of nginx?