@@ -149,26 +149,31 @@ cond %{ACCESS:/path} access("/path") File exists a
149149cond %{CACHE} =hit-fresh cache() == "hit-fresh" Cache lookup result status
150150cond %{CIDR:24,48} =ip cidr(24,48) == "ip" Match masked client IP address
151151cond %{CLIENT-HEADER:X} =foo inbound.req.X == "foo" Original client request header
152- cond %{CLIENT-URL:<C> =bar inbound.url.<C> == "bar" URL component match, ``C `` is ``host ``, ``path `` etc.
152+ cond %{CLIENT-URL:<C> =bar inbound.url.<C> == "bar" URL component match, <:ref: `C<admin-plugins-header-rewrite-url-parts> `> is ``host ``, ``path `` etc.
153+
153154cond %{COOKIE:foo} =bar {in,out}bound.cookie.foo == "bar" Check a cookie value
154- cond %{FROM-URL:<C>} =bar from.url.<C> == "bar" Remap ``From URL `` component match, `` C `` is ``host `` etc.
155- cond %{HEADER:X} =foo {in,out}bound.req.X == "foo" Context sensitive header conditions
156- cond %{ID:UNIQUE} =... id.UNIQUE == "..." Unique transaction identifier
155+ cond %{FROM-URL:<C>} =bar from.url.<C> == "bar" Remap ``From URL `` component match, < :ref: ` C<admin-plugins-header-rewrite-url-parts> `> is ``host `` etc.
156+ cond %{HEADER:X} =fo {in,out}bound.{ req,resp} .X == "fo" Context sensitive header conditions
157+ cond %{ID:UNIQUE} =... id.UNIQUE == "..." ( :ref: ` Unique/request/process<admin-plugins-header-rewrite-id> `) transaction identifier
157158cond %{INTERNAL-TRANSACTION} internal() Check if transaction is internally generated
158159cond %{IP:CLIENT} ="..." inbound.ip == "..." Client's IP address. Same as ``inbound.REMOTE_ADDR ``
159160cond %{IP:INBOUND} ="..." inbound.server == "..." ATS's IP address to which the client connected
160161cond %{IP:SERVER} ="..." outbound.ip == "..." Upstream (next-hop) server IP address
161162cond %{IP:OUTBOUND} ="..." outbound.server == "..." ATS's outbound IP address, connecting upstream
162163cond %{LAST-CAPTURE:<#>} ="..." capture.<#> == "..." Last capture group from regex match (range: `0-9 `)
163164cond %{METHOD} =GET inbound.method == "GET" HTTP method match
164- cond %{NEXT-HOP:<C>} ="bar" outbound.url.<C> == "bar" Next-hop URL component match, `` C `` is ``host `` etc.
165- cond %{NOW:<U>} ="..." now.<U> == "..." Current date/time in format, `` U `` selects time unit
165+ 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.
166+ cond %{NOW:<U>} ="..." now.<U> == "..." Current date/time in format, < :ref: ` U<admin-plugins-header-rewrite-geo> `> selects time unit
166167cond %{RANDOM:500} >250 random(500) > 250 Random number between 0 and the specified range
167168cond %{SSN-TXN-COUNT} >10 ssn-txn-count() > 10 Number of transactions on server connection
168- cond %{TO-URL:<C>} =bar to.url.<C> == "bar" Remap ``To URL `` component match, `` C `` is ``host `` etc.
169+ cond %{TO-URL:<C>} =bar to.url.<C> == "bar" Remap ``To URL `` component match, < :ref: ` C<admin-plugins-header-rewrite-url-parts> `> is ``host `` etc.
169170cond %{TXN-COUNT} >10 txn-count() > 10 Number of transactions on client connection
170171cond %{URL:<C> =bar {in,out}bound.url.<C> == "bar" Context aware URL component match
171- cond ${GEO:<C>} =bar geo.<C> == "bar" IP to Geo mapping. ``C `` is ``country ``, ``asn `` etc.
172+ cond %{GEO:<C>} =bar geo.<C> == "bar" IP to Geo mapping. <:ref: `C<admin-plugins-header-rewrite-geo> `> is country, asn, etc.
173+ cond %{STATUS} =200 inbound.status ==200 Origin http status code
174+ %{TCP-INFO} tcp.info TCP Info struct field values
175+ cond %{HTTP-CNTL:<C>} http.cntl.<C> Check the state of the <:ref: `C<admin-plugins-header-rewrite-set-http-cntl> `> HTTP control
176+ cond %{INBOUND:<C>} {in,out}bound.conn.<c> inbound (:ref: `client, user agent<admin-plugins-header-rewrite-inbound> `) connection to ATS
172177=============================== ================================== ================================================
173178
174179The conditions operating on headers and URLs are also available as operators. E.g.:
@@ -204,16 +209,17 @@ rm-destination QUERY ... remove_query("foo,bar") Remove specified
204209rm-destination QUERY ... [I] keep_query("foo,bar") Keep only specified query keys
205210run-plugin foo.so "args" run-plugin("foo.so", "arg1", ...) Run an external remap plugin
206211set-body "foo" inbound.resp.body = "foo" Set the response body
207- set-body-from "https://..." set-body-from("https://...") Set the response body from a URL
212+ set-body-from "\ h ttps://..." set-body-from("\ h ttps://...") Set the response body from a URL
208213set-config <name> 12 set-config("name", 17) Set a configuration variable to a value
209214set-conn-dscp 8 inbound.conn.dscp = 8 Set the DSCP value for the connection
210215set-conn-mark 17 inbound.conn.mark = 17 Set the MARK value for the connection
211216set-cookie foo bar {in,out}bound.cookie.foo = "bar" Set a request/response cookie named foo
212- set-destination <C> bar inbound.url.<C> = "bar" Set a URL component, `` C `` is path, query etc.
213- set-header X-Bar foo inbound.req.X-Bar = "foo" Assign a client request header
214- set-redirect <Code> <URL> set-redirect(302, "https://...") Set a redirect response
217+ set-destination <C> bar inbound.url.<C> = "bar" Set a URL component, < :ref: ` C<admin-plugins-header-rewrite-url-parts> `> is path, query etc.
218+ set-header X-Bar foo inbound.{ req,resp} .X-Bar = "foo" Assign a client request/origin response header
219+ set-redirect <Code> <URL> set-redirect(302, "\ h ttps://...") Set a redirect response
215220set-status 404 http.status = 404 Set the response status code
216221set-status-reason "No" http.status.reason = "no" Set the response status reason
222+ set-http-cntl http.cntl.<C> = bool Turn on/off <:ref: `C<admin-plugins-header-rewrite-set-http-cntl> `> controllers
217223============================= ================================= ================================================
218224
219225In addition to those operators above, HRW4U supports the following special operators without arguments:
@@ -230,9 +236,9 @@ String concatenations
230236---------------------
231237
232238You can concatenate values using strings, condition values and variable expansions on the same line in
233- operators using. For instance, `outbound.req.CustomHeader “Hello from {inbound.ip}:{inbound.port}” `. As
234- a result, the set-redirect's `[QSA] ` flag would be implemented as `set-redirect(302, "https://...?{inbound.url.query}")``.
235- Note the presence of the `? ` -- the url.query doesn't include it.
239+ operators using. For instance, `` outbound.req.CustomHeader = “Hello from {inbound.ip}:{inbound.port}” ` `. As
240+ a result, the set-redirect's `` [QSA] `` flag would be implemented as ` `set-redirect(302, "https://...?{inbound.url.query}") ``.
241+ Note the presence of the `` ? ` ` -- the url.query doesn't include it.
236242
237243
238244Semantics
@@ -567,9 +573,6 @@ the ``CACHE`` condition results to a header.::
567573 if inbound.resp.All-Cache != "" {
568574 inbound.resp.All-Cache = "{inbound.resp.All-Cache}, {cache()}";
569575 }
570- }
571-
572- SEND_RESPONSE {
573576 if inbound.resp.All-Cache == "" {
574577 inbound.resp.All-Cache = "{cache()}";
575578 }
0 commit comments