From 74374b8152bfeb6d9fb38ddbf068454f98b35466 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 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 "defaults" sections. Add a note explaining
that only the log-format (dynamic) form is allowed there, that a plain server
name is rejected at parse time, and that inheriting backends evaluate their own
rules first and then the ones from the defaults section.
---
 doc/configuration.txt | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/doc/configuration.txt b/doc/configuration.txt
index b5615ba49..74fb6fba2 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,13 @@ 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.
 
+  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. Backends inheriting
+  from such a defaults section evaluate their own "use-server" rules first, then
+  the ones from the defaults section, which 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

