We are using Varnish at the front of Plone. In the case Plone goes down or serves an internal error we\'d like to show a user-friendly static HTML page which some CSS styling +
There isn't much help for doing this with Varnish 4 at the moment.
Here is what I ended up with:
sub vcl_backend_error { set beresp.http.Content-Type = "text/html; charset=utf-8"; synthetic(std.fileread("/var/www/errors/500.html")); return (deliver); }
For more info see the upgrading to 4.0 docs.