From 91e1177e47289bebd82233e5520e8676bb37aa88 Mon Sep 17 00:00:00 2001
From: Alexander Stephan <alexander.stephan@sap.com>
Date: Thu, 24 Sep 2026 08:58:51 +0000
Subject: [PATCH v2 2/3] DOC: configuration: allow "use-server" in defaults
 sections

Update the keyword matrix and the "use-server" keyword section to reflect that
the directive is now accepted in named "defaults" sections. Add a note
explaining that only a named defaults section is allowed, that only the
log-format (dynamic) form is accepted there, that a plain server name is
rejected at parse time, that such a defaults section is backend-only and cannot
be shared with a frontend or a listen section, and that inheriting backends
evaluate the rules from the defaults section first and then their own, like the
other rulesets inherited from a defaults section.
---
 doc/configuration.txt | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/doc/configuration.txt b/doc/configuration.txt
index b5615ba49..f6f6dc14a 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -6300,7 +6300,7 @@ unique-id-format                          X          X         X         X
 unique-id-header                          X          X         X         -
 use_backend                               -          X         X         -
 use-fcgi-app                              -          -         X         X
-use-server                                -          -         X         X
+use-server                                X          -         X         X
 ------------------------------------+----------+----------+---------+---------
  keyword                              defaults   frontend   listen    backend
 
@@ -15399,7 +15399,7 @@ use-server <server> unless <condition>
   May be used in the following contexts: tcp, http
 
   May be used in sections :   defaults | frontend | listen | backend
-                                  no   |    no    |   yes  |   yes
+                                 yes   |    no    |   yes  |   yes
 
   Arguments :
     <server>    is the name of a valid server in the same backend section
@@ -15457,6 +15457,17 @@ use-server <server> unless <condition>
   use-server rule was conditioned by an ACL returning true, no other use-server
   rule is applied and we fall back to load balancing.
 
+  This directive is only available from named "defaults" sections, not anonymous
+  ones. In a "defaults" section, only the Custom log format form is allowed, since
+  a defaults section has no servers against which a simple name could be resolved.
+  A simple server name is therefore rejected at parse time. "use-server" being a
+  backend-only directive, such a defaults section may only be inherited by backend
+  sections; it cannot be shared with a frontend or a listen section. Backends
+  inheriting from such a defaults section evaluate the rules from the defaults
+  section first, then their own "use-server" rules, consistently with the other
+  rulesets inherited from a defaults section. This lets a set of dynamic rules be
+  shared across several backends.
+
   See also: "use_backend", section 5 about server and section 7 about ACLs.
 
 
-- 
2.51.0

