I mean that I know how to avoid these errors, but I think that a better way to fix the issue is to fix it in low level. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,249754,250145#msg-250145