diff options
author | Christian Breunig <christian@breunig.cc> | 2024-04-21 12:51:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-21 12:51:35 +0200 |
commit | 6331040d560641921f44517298271e301ce52646 (patch) | |
tree | 4ffb08c661920b0a33f0f6c0cf8a6dea2b4a5602 /interface-definitions | |
parent | 4cde677e9e128bc9b62fad720b1b6f6cac506954 (diff) | |
parent | 050f24770aec7a74c1a07ba64cf2cb83afb72f1a (diff) | |
download | vyos-1x-6331040d560641921f44517298271e301ce52646.tar.gz vyos-1x-6331040d560641921f44517298271e301ce52646.zip |
Merge pull request #3338 from nvollmar/haproxy-http-check
T6246: improve haproxy http check configuration
Diffstat (limited to 'interface-definitions')
-rw-r--r-- | interface-definitions/load-balancing_reverse-proxy.xml.in | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/interface-definitions/load-balancing_reverse-proxy.xml.in b/interface-definitions/load-balancing_reverse-proxy.xml.in index 645fe30c7..eb01580da 100644 --- a/interface-definitions/load-balancing_reverse-proxy.xml.in +++ b/interface-definitions/load-balancing_reverse-proxy.xml.in @@ -110,29 +110,55 @@ <leafNode name="method"> <properties> <help>HTTP method used for health check</help> + <completionHelp> + <list>options head get post put</list> + </completionHelp> <valueHelp> - <format>options|get|post|put</format> + <format>options|head|get|post|put</format> <description>HTTP method used for health checking</description> </valueHelp> <constraint> - <regex>options|get|post|put</regex> + <regex>(options|head|get|post|put)</regex> </constraint> </properties> </leafNode> <leafNode name="uri"> <properties> <help>URI used for HTTP health check (Example: '/' or '/health')</help> + <constraint> + <regex>^\/([^?#\s]*)(\?[^#\s]*)?$</regex> + </constraint> </properties> </leafNode> - <leafNode name="expect"> + <node name="expect"> <properties> <help>Expected response for the health check to pass</help> - <valueHelp> - <format>txt</format> - <description>expected response (Example: 'status 200-299' or 'string success')</description> - </valueHelp> </properties> - </leafNode> + <children> + <leafNode name="status"> + <properties> + <help>Expected response status code for the health check to pass</help> + <valueHelp> + <format>u32:200-399</format> + <description>Expected response code</description> + </valueHelp> + <constraint> + <validator name="numeric" argument="--range 200-399"/> + </constraint> + <constraintErrorMessage>Status code must be in range 200-399</constraintErrorMessage> + </properties> + </leafNode> + <leafNode name="string"> + <properties> + <help>Expected to be in response body for the health check to pass</help> + <valueHelp> + <format>txt</format> + <description>A string expected to be in the response</description> + </valueHelp> + </properties> + </leafNode> + </children> + </node> </children> </node> #include <include/haproxy/rule-backend.xml.i> |