ERR_CONTENT_LENGTH_MISMATCH on nginx and proxy on Chrome when loading large files

It seems that under pressure, nginx tried to pull angular.js from its cache and couldn't due to permission issues. Here's what solved this issue:

root@amac-2:/usr/local/var/run/nginx $ chown -R _www:admin proxy_temp

_www:admin might be different in your case, depending which user owns the nginx process. See more information on ServerFault:

https://serverfault.com/questions/534497/why-do-nginx-process-run-with-user-nobody


Adding the following line to the nginx config was the only thing that fixed the net::ERR_CONTENT_LENGTH_MISMATCH error for me:

proxy_buffering off;

I tried all of the above and still couldn't get it to work. Even after resorting to chmod 777. The only thing that solved it for me was to disable caching entirely:

proxy_max_temp_file_size 0;

Whilst not a fix and no good for production use this was OK for me since I'm only using nginx as part of a local development setup.