From eea88e41ab5f62802ed4b5e495dc41a764e4ad50 Mon Sep 17 00:00:00 2001 From: Piotr Rogowski Date: Thu, 27 Oct 2022 13:14:15 +0200 Subject: [PATCH] OVerwrite 500 errors by varnish --- roles/cs.varnish/templates/vcl/subroutines/deliver.vcl.j2 | 2 +- roles/cs.varnish/templates/vcl/subroutines/synth.vcl.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/cs.varnish/templates/vcl/subroutines/deliver.vcl.j2 b/roles/cs.varnish/templates/vcl/subroutines/deliver.vcl.j2 index c73f659b0..4ba0e23a6 100644 --- a/roles/cs.varnish/templates/vcl/subroutines/deliver.vcl.j2 +++ b/roles/cs.varnish/templates/vcl/subroutines/deliver.vcl.j2 @@ -33,7 +33,7 @@ if (req.http.{{ varnish_debug_request_info_header_name }}) { req.http.{{ varnish_debug_request_info_header_name }} + "; Backend-Response-Delivered"; } -if (resp.status == 502 || resp.status == 504) { +if (resp.status == 500 || resp.status == 502 || resp.status == 504) { return(synth(resp.status)); } diff --git a/roles/cs.varnish/templates/vcl/subroutines/synth.vcl.j2 b/roles/cs.varnish/templates/vcl/subroutines/synth.vcl.j2 index 431481778..42edd283f 100644 --- a/roles/cs.varnish/templates/vcl/subroutines/synth.vcl.j2 +++ b/roles/cs.varnish/templates/vcl/subroutines/synth.vcl.j2 @@ -19,7 +19,7 @@ if ((resp.status == 301 || resp.status == 302) && req.http.location) { return (deliver); } -if (resp.status == 502 || resp.status == 503 || resp.status == 504) { +if (resp.status == 500 || resp.status == 502 || resp.status == 503 || resp.status == 504) { {{ synthetic_error_page() }} return (deliver);