Automatic Cluster Responders
Equalizer Installation and Administration Guide
155
•
parse the URL of an incoming request
•
break it down into separate strings (based on the positions of literal characters in the expression)
•
assign each string to a named variable
These named variables can then be used in the URL field of the Redirect Responder. When the Responder replies to
a client, it performs string substitution on the URL.
Because the purpose of using regular expressions to perform string substitution in Redirect URLs is to parse request
URLs into strings, constructing an appropriate regular expression requires an exact knowledge of the format of the
request URLs that will typically be coming in to the cluster IP.
Equalizer supports POSIX-style extended regular expressions, as described in Appendix D, ”Regular Expression
Format” on page 273.
See the examples that follow below to help you understand how regular expressions are constructed and interpreted
by Responders.
Example 1 -- HTTPS Redirect
The simplest form of HTTPS redirect involves simply referring the user to the top level of the https:// site, regardless
of the path information that may have been included in the original request URL. For example, we could direct all
requests for:
http://www.example.com/<path>
to:
https://www.example.com
But, this forces the client to re-specify the <path> after the redirect. It would be better to redirect to a URL that
includes the path information:
https://www.example.com/<path>
The following regular expression:
^(([^ :/?#]+):)?//(.*)
breaks a request URL into the following named variables:
$0
http://www.example.com/
<path>
$1
http
$2
http:
$3
www.example.com/<path>
We can then use these variables in the URL field as shown in the following Responder configuration screen:
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 ...