feat: support http_method and http_req_body in active health checks - #13726
Merged
AlinsRan merged 3 commits intoJul 23, 2026
Conversation
Bump lua-resty-healthcheck-api7 to 3.2.3, which lets an active health-check probe be sent as any HTTP method with a request body instead of a bodyless GET. Expose the two new fields on `upstream.checks.active`: - `http_method` (default "GET") - `http_req_body` (default ""), a non-empty body adds a Content-Length header This lets ai-proxy-multi (and any upstream) probe an endpoint with a real request -- e.g. health-check an LLM provider with a chat-completion POST body. Defaults keep the previous GET-without-body behavior, so it is backward compatible. 3.2.3 also changes the probe debug log label from "request head:" to "request:"; update the ai-proxy-vertex-ai assertion accordingly.
An inline [[..]] route JSON this large trips OpenResty 1.29's config-parser long-bracket buffer (nginx fails to start: 'Lua code block missing the closing long bracket'). Build the route as a Lua table encoded with core.json.encode instead.
nic-6443
approved these changes
Jul 23, 2026
shreemaan-abhishek
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The active health-check probe is currently hard-coded to a bodyless
GET. This PR bumpslua-resty-healthcheck-api7to3.2.3and exposes two new fields onupstream.checks.activeso a probe can be sent as any HTTP method with a request body:http_method— defaultGEThttp_req_body— default""; a non-empty body adds a matchingContent-LengthheaderThis lets an upstream be probed with a real request instead of a bare GET — for example, health-checking an LLM provider through
ai-proxy-multiwith an actual chat-completionPOSTbody.Defaults keep the previous
GET-without-body behavior, so it is backward compatible.Changes
apisix-master-0.rockspec:lua-resty-healthcheck-api73.2.2-0→3.2.3-0apisix/schema_def.lua: addhttp_method/http_req_bodytohealth_checker_active(movedmethod_schemaup so the enum can be reused)docs/.../health-check.md: document the two fieldst/plugin/ai-proxy-multi3.t: add a test that configures a POST-body probe and asserts the target receives the expected method / headers / bodyt/plugin/ai-proxy-vertex-ai.t: 3.2.3 changed the probe debug log label fromrequest head:torequest:; update the assertionNotes
3.2.3is a backward-compatible superset of3.2.2(the probe request is byte-identical for the default GET-without-body case; the only behavioral change for existing users is the debug log label).