<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6001.18183" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV>As a follow up, is there any way to get the amount of data sent in the 
  upstream request? I can then compare to content-length and see if the request 
  completed successfully or not. I have proxy_set_header X-Original-Length 
  $content_length, but this doesn't appear on the post_action 
  whereas&nbsp;proxy_set_header X-Original-Uri $request_uri 
does.</DIV></BLOCKQUOTE>
<DIV><FONT face=Arial size=2>You mean you want the number of bytes sent to the 
client? If so, then yes we do this with:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_set_header 
RateBytes $body_bytes_sent;<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>One thing to be aware of though, is that this is 
bytes sent by nginx. Your OS might have quite large TCP buffers, so nginx might 
send the whole response to the TCP buffers, but the client might kill the 
connection before it's all downloaded. I don't think there's any sane way of 
detecting that other than making your TCP buffers small (potential performance 
implications), or using some lower level tracking method.</DIV></FONT>
<DIV><FONT face=Arial size=2>&nbsp;</DIV></FONT>
<DIV><FONT face=Arial size=2>Rob</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;</DIV></FONT></BODY></HTML>