Tracking sent responses

Sergey Brester serg.brester at
Tue Nov 10 19:29:36 UTC 2015



I'm sure you can do that using on-board "equipment" of nginx, without
deep integrating to the nginx (without write of own module). 

You can use for this a "post_action", something like:

 post_action @after_request_location; 

But (There is always a "but":), according to my last known stand: 

- the feature "post_action" is asynchronously;
- the feature is not documentated (and possibly not recommended to
use);- if location "executed" in post_action uses upstreams (fcgi,
proxy_pass, etc.), it will always breaks a keepalive connection to the
upstream channel (possibly fixed, but I've missed). 


Am 10.11.2015 19:51, schrieb Julien FROMENT: 

> Hello, 
> We would like to use Nginx to keep track of exactly what part of an upstream's server response was sent over a socket. Nginx could call an API asynchronously with the number of bytes sent over the socket for a given request. 
> Here is the pseudo code: 
> -- Client send a request 
> -- Nginx processes the request and send it to the upstream 
> ... 
> -- The upstream returns the response 
> -- Nginx sends the response to the client 
> -- Nginx calls Async API with the number of bytes sent 
> I read a little bit of "Emiller's Guide To Nginx Module Development", and I think we could write a Handler that provide some tracking information. But I am unsure if it is possible to hook it at a low enough level for our needs. 
> Are there any expert on this mailing list that could provide us consulting services and guide us through the development of such functionality? 
> Thanks in advance! 
> Julien 
> #
> " Ce courriel et les documents qui lui sont joints peuvent contenir des
> informations confidentielles ou ayant un caractè privÃ(c)S'ils ne vous sont
> pas destinÃ(c) nous vous signalons qu'il est strictement interdit de les
> divulguer, de les reproduire ou d'en utiliser de quelque maniè que ce
> soit le contenu. Si ce message vous a Ã(c) transmis par erreur, merci d'en
> informer l'expÃ(c)teur et de supprimer immÃ(c)atement de votre systè
> informatique ce courriel ainsi que tous les documents qui y sont attachÃ(c)"
> ******
> " This e-mail and any attached documents may contain confidential or
> proprietary information. If you are not the intended recipient, you are
> notified that any dissemination, copying of this e-mail and any attachments
> thereto or use of their contents by any means whatsoever is strictly
> prohibited. If you have received this e-mail in error, please advise the
> sender immediately and delete this e-mail and all attached documents
> from your computer system."
> #
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at
> [1]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx-devel mailing list