Chapter 8: Using Match Rules
212
Equalizer Installation and Administration Guide
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:
•
pathname
() return
s true if its argument matches
/somedir/somepage.html
•
dirname
() retu
rns true if its argument matches
/somedir/
•
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).
Some function arguments can take the form of a regular expression
1
. Note that you cannot put regular expressions
into match expressions except as an argument to a function whose definition supports regular expressions.
Match Bodies
Match bodies specify the actions to take if the match expression selects the request. This is specified in the form of
statements that provide values to variables used by the load balancer to process the request. The most common (and
most useful) match body selects the set of servers over which to apply the load balancing:
servers = all;
The
servers
assignment statement takes a comma-separated list of server names, which specifies the set of servers
to be used for load balancing all requests that match the expression in the match rule. The reserved server names
all
and
none
specify respectively the set of
all
servers in the virtual cluster and
none
of the servers in the virtual
cluster. If you do not assign servers, none will be available for load balancing; as a result, the connection to the
client will be dropped.
In general, you can override most cluster-specific variables in a match body. (You can override protocol-specific
variables as well, but that does not always make sense.) One useful example of overriding variables is as follows:
servers = s0, s1, s2;
flags = !once_only;
which would load-balance across the specified servers (which first must be defined in the virtual cluster) and also
turn off the
once_only
flag for the duration of processing of that connection.
1. Regular expressions are specified according to IEEE Std 1003.2 (“POSIX.2”).
Note –
Matching regular
ex
pressions (
using
*_regex
() functions
) is many times more processing-intensive than
using other match functions. It is usually possible to avoid using regular expressions by carefully crafting match
expressions using other functions. For example, the following regular expression match:
dirname_regex("(two|four|six|eight)")
Can be replaced by the more efficient:
dirname_substr("two") ||
dirname_substr("four") ||
dirname_substr("six") ||
dirname_substr("eight")
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 ...