Chapter 8: Using Match Rules
224
Equalizer Installation and Administration Guide
makes sense to route the request to the (for example) down server, and have the client receive an appropriate error --
so that the request can be retried.
If we instead were to skip a match rule because, for example, the server selected by the match rule is down, the
request would be evaluated by the next match rule -- or the default match rule. The request, therefore, could
potentially be sent to a server in the cluster that does not have the requested content. This means that the client
would receive a “not found” error, instead of an error indicating that the appropriate server is not currently available.
Considering Case in String Comparisons
String comparisons performed by match functions honor the setting of the
ignore case
cluster parameter: if it is set
on the cluster (the default), then all match rule functions used for that cluster are case insensitive; that is, the case of
strings is ignored. For example, the string “ab” will match occurrences of “ab”, “Ab”, “aB”, and “AB”. If
ignore
case
is
not
set on the cluster, then all string comparisons are by default case sensitive (the string “ab” will match
only “ab”).
To override the
ignore case
flag setting on the cluster for a match function or block of functions, you must logically
AND the
observe_case()
or
ignore_case()
functions with the match function or block. For example, if
ignore case
is set on the cluster, you would use the following construct to force the
header_substr()
function to make case
sensitive string comparisons:
(observe_case() AND header_substr("host", "MySystem"))
Regular Expressions
Some match functions have
prefix
,
suffix
,
substr
, or
regex
variants. The
regex
variants interpret an argument as a
regular expression to match against requests. Regular expressions can be very costly to compute, so use the
prefix
,
suffix
, or
substr
variants of functions (or Boolean combinations of prefix and suffix testing), rather than the
regex
function variants, for best performance. For example, the following regular expression match:
dirname_regex("(two|four|six|eight)")
Can be replaced by the more efficient:
dirname_substr("two") OR
dirname_substr("four") OR
dirname_substr("six") OR
dirname_substr("eight")
Equalizer supports POSIX regular expression syntax only. See Appendix D, ”Regular Expression Format” for a
description.
Supported Headers
All of the
header_*(
header
,
string
)
match functions take a
header
argument, which selects the header of interest. If
this header is not present in the request, the match function evaluates to
false
. Otherwise, the text associated with the
header is examined depending on the particular function.
Although HTTP permits a header to span multiple request lines, none of the functions matches text on more than
one line. In addition, Equalizer will only parse the first instance of a header. If, for example, a request has multiple
cookie
headers, Equalizer will only match against the first
cookie
header in the request.
The list of supported headers for the
header
argument are as follows:
Accept
From
Referer
Accept-Charset
Host
TE
Summary of Contents for E350GX
Page 18: ...Chapter Preface 18 Equalizer Installation and Administration Guide ...
Page 38: ...Chapter 1 Equalizer Overview 38 Equalizer Installation and Administration Guide ...
Page 80: ...Chapter 4 Equalizer Network Configuration 80 Equalizer Installation and Administration Guide ...
Page 110: ...Chapter 5 Configuring Equalizer Operation 110 Equalizer Installation and Administration Guide ...
Page 208: ...Chapter 7 Monitoring Equalizer Operation 208 Equalizer Installation and Administration Guide ...
Page 240: ...Chapter 8 Using Match Rules 238 Equalizer Installation and Administration Guide ...
Page 262: ...Appendix A Server Agent Probes 258 Equalizer Installation and Administration Guide ...
Page 274: ...Appendix B Timeout Configuration 270 Equalizer Installation and Administration Guide ...
Page 280: ...Appendix D Regular Expression Format 276 Equalizer Installation and Administration Guide ...
Page 310: ...Appendix F Equalizer VLB 306 Equalizer Installation and Administration Guide ...
Page 318: ...Appendix G Troubleshooting 314 Equalizer Installation and Administration Guide ...