how to read $body_bytes_sent nginx variable

Phani Sreenivasa Prasad nginx-forum at
Tue Nov 22 10:21:45 UTC 2016


I want to read the nginx the value of nginx variable $body_bytes_sent from
my fastcgi application to check how many bytes nginx had sent to client? 

I tried something below

fastcgi_param BODY_BYTES_SENT $body_bytes_sent in my fastcgi_params

and trying to read the fastcgi param value from the fastcgi application. But
it always returns 0. 

Please help me how to read nginx variables(apart from those defined default
in fastcgi_params file) from my fastcgi app and when to read? I need to know
when the value of $body_bytes_sent will get populated?

Posted at Nginx Forum:,271108,271108#msg-271108

More information about the nginx mailing list