From 3825f6048b61c2f4d9177ee545fe5260e8e915d9 Mon Sep 17 00:00:00 2001 From: Matthew Baggett <matthew@baggett.me> Date: Thu, 1 Aug 2024 18:24:12 +0200 Subject: [PATCH] add a health check endpoint to nginx. --- NginxDefault | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/NginxDefault b/NginxDefault index 7bbe9ab..05192db 100644 --- a/NginxDefault +++ b/NginxDefault @@ -22,8 +22,14 @@ server { # deny access to .htaccess files, if Apache's document root # concurs with nginx's one - # location ~ /\.ht { deny all; } + + # Health check endpoint + location /health { + access_log off; + add_header 'Content-Type' 'application/json'; + return 200 '{"status":"Healthy"}'; + } }