I have a Node.js application running in two AWS instances behind a ELB instance. Every now and then, I get errors such as ERR_INVALID_CHUNKED_ENCODING or ERR_CONTENT_LENGTH_MISMATCH. This is observed in both Chrome and Safari in Mac.
The behavior is as if the browser drops the connection as soon as it throws the error. This happens for static assets served from the Node.js application as well.
What's interesting about this issue is that it only happens from time to time. I've both cleared browser cache and disabled cache from dev tools but that didn't solve the problem.
Another interesting thing is that hitting the AWS directly without ELB doesn't generate the errors. I've also tried accessing the ELB directly (and not through the domain name registered at GoDaddy) and it doesn't seem to generate the errors either.
Any nudge in the right direction would be extremely helpful. Thanks.