Content-Length compared to actual size before caching

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs