
Match Rules
!expression
giving rise to the next simplest example:
!any()
which always evaluates to
false
and always results in the match rule not being selected.
With the addition of the logical OR (||) and logical AND (&&) operators, you can specify complex expressions,
selecting precise attributes from the request, as in this:
!happy() || (round() && happy())
Match expressions are read from left to right. Expressions contained within parentheses get evaluated before other
parts of the expression. The previous expression would match anything that was not happy or that was round and
happy.
Unlike the previous example, match functions correspond to certain attributes in a request header.
For example, a request URI for a web page might look like this:
\Get /somedir/somepage.html http/1.1
Accept: text/html, text/*, *.*
Accept-Encoding: gzip
Host: www.coyotepoint.com
User-Agent: Mozilla/4.7 [en] (Win98; U)
Various functions return true when their arguments match certain components of the request URI. Using the above
request URI, for example, you could use several match functions:
l pathname() return
s true if its argument matches
/somedir/somepage.html
l dirname() retu
rns true if its argument matches
/somedir/
l filename() retu
rns true if its argument matches
somepage.html
Other functions can evaluate the contents of the Host header in the request URI above:
host (www.coyotepoint.com)
host_prefix (www)
host_suffix (coyotepoint.com).
322
Copyright © 2013 Coyote Point Systems. A subsidiary of Fortinet, Inc.
Comentários a estes Manuais