From 5f8688fb7077d1b8882e7d23abb23d131e052065 Mon Sep 17 00:00:00 2001 From: MayaChat Date: Mon, 24 Nov 2025 12:46:06 -0500 Subject: [PATCH] Add support for custom health check paths in healthcheck function --- backend/health-proxy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/health-proxy.py b/backend/health-proxy.py index fd54fd7..34e247b 100644 --- a/backend/health-proxy.py +++ b/backend/health-proxy.py @@ -45,6 +45,7 @@ def healthcheck(): host_attr = svc.get('host') proto_attr = svc.get('proto') or proto port_attr = svc.get('port') or port + health_path = svc.get('health-path', '') # Custom health check path (e.g., /api/health, /ping) # prefer local-ip if present target_host = local_ip or root_tailscale or (host_attr.split(':')[0] if host_attr and ':' in host_attr else None) or host @@ -60,7 +61,9 @@ def healthcheck(): if not host or not port: return jsonify({'error': 'missing parameters, expected host and port or id'}), 400 - url = f"{proto}://{host}:{port}" + # Build URL with optional custom health path + health_path = health_path if 'health_path' in locals() else '' + url = f"{proto}://{host}:{port}{health_path}" try: # Use HEAD to do a lightweight check