To make the question simpler:
Is it possible to set a variable per request before the NGINX rewrite phase and use that variable in the access logs?
Is this IMPOSSIBLE in NGINX?
Setting a variable requires nginx to go through the rewrite phase. If the request processing stops before that phase, this variable will never be set. This happens, for instance, when you send a request without end-of-header "/r/n/r/n".
Is it possible to set a variable per request before the NGINX rewrite phase and use that variable in the access logs?
Is this IMPOSSIBLE in NGINX?
Setting a variable requires nginx to go through the rewrite phase. If the request processing stops before that phase, this variable will never be set. This happens, for instance, when you send a request without end-of-header "/r/n/r/n".