About 90% of the unexplainable Varnish 503 errors I’ve seen the last year have been caused by Apache having mod_deflate enabled while there’s a varnish cache in front of it. This happens mostly with PDF files not being able to download, they just give the infamous white screen of death with nothing being logged.
The solution is simple:
- disable mod_deflate in Apache
- enable gzip compression of Varnish output
This is probably also true for nginx servers, where you then need to disable gzip compression.