@@ -181,7 +181,9 @@ cond %{ACCESS:/path} access("/path") File exists
181181cond %{CACHE} =hit-fresh cache() == "hit-fresh" Cache lookup result status
182182cond %{CIDR:24,48} =ip cidr(24,48) == "ip" Match masked client IP address
183183cond %{CLIENT-HEADER:X} =foo inbound.req.X == "foo" Original client request header
184+ cond %{SERVER-HEADER:X} =foo outbound.req.X == "foo" Server request header (sent to origin)
184185cond %{CLIENT-URL:<C>} =bar inbound.url.<C> == "bar" URL component match, <:ref: `C<admin-plugins-header-rewrite-url-parts> `> is ``host ``, ``path `` etc.
186+ cond %{SERVER-URL:<C>} =bar outbound.url.<C> == "bar" Server request URL component (sent to origin)
185187cond %{COOKIE:foo} =bar {in,out}bound.cookie.foo == "bar" Check a cookie value
186188cond %{FROM-URL:<C>} =bar from.url.<C> == "bar" Remap ``From URL `` component match, <:ref: `C<admin-plugins-header-rewrite-url-parts> `> is ``host `` etc.
187189cond %{HEADER:X} =fo {in,out}bound.{req,resp}.X == "fo" Context sensitive header conditions
@@ -195,22 +197,36 @@ cond %{IP:SERVER} ="..." outbound.ip == "..." Upstream (ne
195197cond %{IP:OUTBOUND} ="..." outbound.server == "..." ATS's outbound IP address, connecting upstream
196198cond %{LAST-CAPTURE:<#>} ="..." capture.<#> == "..." Last capture group from regex match (range: `0-9 `)
197199cond %{METHOD} =GET inbound.method == "GET" HTTP method match
198- 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.
200+ cond %{NEXT-HOP:<C>} ="bar" nexthop. <C> == "bar" Next-hop destination, `` <C> `` is ``host ``, `` port ``, or `` strategy ``
199201cond %{NOW:<U>} ="..." now.<U> == "..." Current date/time in format, <:ref: `U<admin-plugins-header-rewrite-geo> `> selects time unit
200202cond %{OUTBOUND:CLIENT-CERT:<X>} outbound.client-cert.<X> Access the mTLS / client certificate details, on the outbound (upstream) connection
201203cond %{OUTbOUND:SERVER-CERT:<X>} outbound.client-cert.<X> Access the server (handshake) certificate details, on the outbound connection
202204cond %{RANDOM:500} >250 random(500) > 250 Random number between 0 and the specified range
203205cond %{SSN-TXN-COUNT} >10 ssn-txn-count() > 10 Number of transactions on server connection
204206cond %{TO-URL:<C>} =bar to.url.<C> == "bar" Remap ``To URL `` component match, <:ref: `C<admin-plugins-header-rewrite-url-parts> `> is ``host `` etc.
205207cond %{TXN-COUNT} >10 txn-count() > 10 Number of transactions on client connection
206- cond %{URL:<C> =bar {in,out}bound .url.<C> == "bar" Context aware URL component match
208+ cond %{URL:<C> =bar inbound .url.<C> == "bar" Context aware URL component match (use `` inbound.url `` or `` outbound.url ``)
207209cond %{GEO:<C>} =bar geo.<C> == "bar" IP to Geo mapping. <:ref: `C<admin-plugins-header-rewrite-geo> `> is country, asn, etc.
208210cond %{STATUS} =200 inbound.status ==200 Origin http status code
209211cond %{TCP-INFO} tcp.info TCP Info struct field values
210212cond %{HTTP-CNTL:<C>} http.cntl.<C> Check the state of the <:ref: `C<admin-plugins-header-rewrite-set-http-cntl> `> HTTP control
211213cond %{INBOUND:<C>} {in,out}bound.conn.<c> inbound (:ref: `client, user agent<admin-plugins-header-rewrite-inbound> `) connection to ATS
212214================================ ================================== ================================================
213215
216+ .. note ::
217+ **Header and URL prefix summary: **
218+
219+ - ``inbound.req.<header> `` → ``CLIENT-HEADER `` - Headers from the client request
220+ - ``outbound.req.<header> `` → ``SERVER-HEADER `` - Headers in the request sent to origin
221+ - ``inbound.url.<part> `` → ``CLIENT-URL `` - URL from the original client request
222+ - ``outbound.url.<part> `` → ``SERVER-URL `` - URL in the request sent to origin (after remapping)
223+ - ``nexthop.<field> `` → ``NEXT-HOP `` - Network destination info (host, port, strategy)
224+
225+ The distinction between ``outbound.url `` and ``nexthop `` is important:
226+
227+ - ``outbound.url `` is the HTTP request URL (what's in the request line/Host header)
228+ - ``nexthop `` is the network destination (where ATS connects, may be a parent proxy)
229+
214230The conditions operating on headers and URLs are also available as operators. E.g.:
215231
216232.. code-block :: none
@@ -271,9 +287,9 @@ HRW4U provides a special ``+=`` operator for adding headers::
271287
272288The ``+= `` operator only works with the following pre-defined symbols:
273289
274- - ``inbound.req.<header> `` - Client request headers
290+ - ``inbound.req.<header> `` - Client request headers (maps to `` CLIENT-HEADER ``)
275291- ``inbound.resp.<header> `` - Origin response headers
276- - ``outbound.req.<header> `` - Outbound request headers (context-restricted )
292+ - ``outbound.req.<header> `` - Server request headers (maps to `` SERVER-HEADER `` )
277293- ``outbound.resp.<header> `` - Outbound response headers (context-restricted)
278294
279295.. note ::
0 commit comments