Commit 64c3b786 authored by Jürgen Haas's avatar Jürgen Haas

ansible-inventories/arocom#2898 Prepare Varnish health check in HaProxy

parent 47053255
......@@ -112,6 +112,16 @@ sub vcl_recv {
return (pass);
}
# Health Check
if (req.url == "/varnishcheck") {
return(synth(751, "OK!"));
#if (req.backend.healthy) {
# return(synth(751, "OK!"));
#} else {
# return(synth(752, "FAILED!"));
#}
}
# Some generic URL manipulation, useful for all templates that follow
# First remove the Google Analytics added parameters, useless for our backend
if (req.url ~ "(\?|&)(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=") {
......@@ -411,6 +421,16 @@ sub vcl_synth {
return (deliver);
}
# Health Checks
if (resp.status == 751) {
set resp.status = 200;
return (deliver);
}
if (resp.status == 752) {
set resp.status = 503;
return (deliver);
}
synthetic({"
<!doctype html>
<title>Site Maintenance | Wartung</title>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment