Content-Length compared to actual size before caching

ggrensteiner nginx-forum at nginx.us
Sat Mar 10 00:14:24 UTC 2012


If my upstream goes away I get an error 

 upstream prematurely closed connection while reading response header
from upstream

or 
 
 recv() failed (104: Connection reset by peer) while reading response
header from upstream

unfortunately, this still gives me a 200 code and this return is entered
incomplete into my memcache.  Is there some way to get the size of the
current request from proxy_pass so I can compare it to the
Content_Length and discard it if it's mismatched?

Ideally the system wouldn't tag incomplete responses as 200 OK, so they
wouldn't end up as short returns in my memcache for their cache
duration.

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



More information about the nginx mailing list