User-friendly error pages from Varnish

前端 未结 4 1910
说谎
说谎 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:02

    You can customize the synthetic page being served on a vlc_error. The default.vcl configuration file already shows how to do this, by serving the famous "Guru Meditation" error page (ahh, those wonderful Amiga days).

    An example customization:

        sub vcl_error {
            set obj.http.Content-Type = "text/html; charset=utf-8";
            synthetic {"
        
        
        
          
            Sorry, server under maintainance - My Website"
            
          
          
            

    The server is being updated

    Please check back later. Meanwhile, here's a picture of a rabbit with a pancake on its head:

    awwwww! "}; return (deliver); }

提交回复
热议问题