Log request at request time, not after response

vinayak.ponangi nginx-forum at forum.nginx.org
Tue Jun 25 15:58:55 UTC 2019


Hi All,

I am trying to understand if it's possible to extend nginx functionality to
support what I am looking for.

Problem:

We are trying to look for poison pill in-flight requests that would affect
backend cluster stability. We currently cannot do much for the first
request, but the idea is to block subsequent requests from the same user. 

Ideally we would have solved it at the app layer, but seems like there's a
lot of work involved with that solution. So we are trying to solve it at the
nginx level.

But looks like nginx can only do logging after a response is received from
the backend server. Is it possible to modify this behavior to log at request
time without waiting for a response. IMHO this is a reasonable thing to do.


I am open to alternative approaches to solve this problem. I would also like
to know if there are any available modules/plugins that could be easily
tweaked to emit the request log.

If this was intended by design for nginx, it would be nice to understand
what the reasoning behind such a decision was.

Thank you very much for your time.
Appreciate all the help I can get.

Regards,
Vinayak Ponangi

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,284660,284660#msg-284660



More information about the nginx mailing list