vigil
vigil copied to clipboard
301/302 redirections and http_body_healthy_match
When dealing with replica that has redirections:
curl -I https://experiments-alicdn.sparanoid.net/algolia.js
HTTP/1.1 302 Moved Temporarily
Date: Sat, 25 Sep 2021 13:28:37 GMT
Location: https://cdn.jsdelivr.net/algoliasearch/latest/algoliasearch.min.js
...
In Vigil config:
[[probe.service.node]]
id = "algolia-search"
label = "Algolia Search"
mode = "poll"
replicas = [
"https://experiments-alicdn.sparanoid.net/algolia.js",
]
http_body_healthy_match = "algoliasearch"
The http_body_healthy_match
will fall since the body are changed:
<html>
<head><title>302 Found</title></head>
<body>
<center><h1>302 Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
That would be great if there's an option to follow directions.
Hello there!
Since Vigil is a monitoring system, was not built to follow redirections, rather to poll for an HTTP status code at the URL provided, and perform direct matching of this status code.
In that case you'd need either to monitor for 302 as a valid code, or configure your Vigil to monitor the new URL.