@@ -236,7 +236,7 @@ Conditions
236236Below is a partial mapping of `header_rewrite ` condition symbols to their HRW4U equivalents:
237237
238238================================= ================================== ================================================
239- Header Rewrite HRW4U Description
239+ Header Rewrite HRW4U Description
240240================================= ================================== ================================================
241241cond %{ACCESS:/path} access("/path") File exists at "/path" and is accessible by ATS
242242cond %{CACHE} =hit-fresh cache() == "hit-fresh" Cache lookup result status
@@ -258,12 +258,14 @@ cond %{IP:SERVER} ="..." outbound.ip == "..." Upstream (n
258258cond %{IP:OUTBOUND} ="..." outbound.server == "..." ATS's outbound IP address, connecting upstream
259259cond %{LAST-CAPTURE:<#>} ="..." capture.<#> == "..." Last capture group from regex match (range: `0-9 `)
260260cond %{METHOD} =GET inbound.method == "GET" HTTP method match
261- cond %{NEXT-HOP:<C>} ="bar" outbound.url. <C> == "bar" Next-hop URL component match, < :ref: ` C<admin-plugins-header-rewrite-url-parts> `> is ``host `` etc.
261+ cond %{NEXT-HOP:<C>} ="bar" nexthop. <C> == "bar" Next-hop destination, `` <C> `` is ``host ``, `` port ``, or `` strategy ``
262262cond %{NEXT-HOP:QUERY:<P>} =bar outbound.url.query.<P> == "bar" Extract specific query parameter ``P `` from next-hop URL
263263cond %{NOW:<U>} ="..." now.<U> == "..." Current date/time in format, <:ref: `U<admin-plugins-header-rewrite-geo> `> selects time unit
264264cond %{OUTBOUND:CLIENT-CERT:<X>} outbound.client-cert.<X> Access the mTLS / client certificate details, on the outbound (upstream) connection
265265cond %{OUTbOUND:SERVER-CERT:<X>} outbound.client-cert.<X> Access the server (handshake) certificate details, on the outbound connection
266266cond %{RANDOM:500} >250 random(500) > 250 Random number between 0 and the specified range
267+ cond %{SERVER-HEADER:X} =foo outbound.req.X == "foo" Server request header (sent to origin)
268+ cond %{SERVER-URL:<C>} =bar outbound.url.<C> == "bar" Server request URL component (sent to origin)
267269cond %{SSN-TXN-COUNT} >10 ssn-txn-count() > 10 Number of transactions on server connection
268270cond %{TO-URL:<C>} =bar to.url.<C> == "bar" Remap ``To URL `` component match, <:ref: `C<admin-plugins-header-rewrite-url-parts> `> is ``host `` etc.
269271cond %{TO-URL:QUERY:<P>} =bar to.url.query.<P> == "bar" Extract specific query parameter ``P `` from remap ``To URL ``
@@ -276,6 +278,20 @@ cond %{HTTP-CNTL:<C>} http.cntl.<C> Check the s
276278cond %{INBOUND:<C>} {in,out}bound.conn.<c> inbound (:ref: `client, user agent<admin-plugins-header-rewrite-inbound> `) connection to ATS
277279================================= ================================== ================================================
278280
281+ .. note ::
282+ **Header and URL prefix summary: **
283+
284+ - ``inbound.req.<header> `` → ``CLIENT-HEADER `` - Headers from the client request
285+ - ``outbound.req.<header> `` → ``SERVER-HEADER `` - Headers in the request sent to origin
286+ - ``inbound.url.<part> `` → ``CLIENT-URL `` - URL from the original client request
287+ - ``outbound.url.<part> `` → ``SERVER-URL `` - URL in the request sent to origin (after remapping)
288+ - ``nexthop.<field> `` → ``NEXT-HOP `` - Network destination info (host, port, strategy)
289+
290+ The distinction between ``outbound.url `` and ``nexthop `` is important:
291+
292+ - ``outbound.url `` is the HTTP request URL (what's in the request line/Host header)
293+ - ``nexthop `` is the network destination (where ATS connects, may be a parent proxy)
294+
279295The conditions operating on headers and URLs are also available as operators. E.g.:
280296
281297.. code-block :: none
@@ -336,9 +352,9 @@ HRW4U provides a special ``+=`` operator for adding headers::
336352
337353The ``+= `` operator only works with the following pre-defined symbols:
338354
339- - ``inbound.req.<header> `` - Client request headers
355+ - ``inbound.req.<header> `` - Client request headers (maps to `` CLIENT-HEADER ``)
340356- ``inbound.resp.<header> `` - Origin response headers
341- - ``outbound.req.<header> `` - Outbound request headers (context-restricted )
357+ - ``outbound.req.<header> `` - Server request headers (maps to `` SERVER-HEADER `` )
342358- ``outbound.resp.<header> `` - Outbound response headers (context-restricted)
343359
344360.. note ::
0 commit comments