User-friendly error pages from Varnish

前端 未结 4 1908
说谎
说谎 2021-02-04 07:49

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 +

4条回答
  •  忘了有多久
    2021-02-04 08:13

    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.

提交回复
热议问题