add healthcheck public method, map by default to /healthz
This commit is contained in:
parent
865ecc8796
commit
3181272619
|
@ -34,6 +34,8 @@ http {
|
||||||
internal;
|
internal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rewrite ${APP_BASE}/healthz ${APP_BASE}/public.php?op=healthcheck;
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
|
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
|
|
|
@ -643,7 +643,9 @@ class Config {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) > 0 && php_sapi_name() != "cli") { ?>
|
if (count($errors) > 0 && php_sapi_name() != "cli") {
|
||||||
|
http_response_code(503); ?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
|
@ -834,5 +834,11 @@ class Handler_Public extends Handler {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// implicit Config::sanity_check() does the actual checking */
|
||||||
|
public function healthcheck() {
|
||||||
|
header("Content-Type: text/plain");
|
||||||
|
print "OK";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue