After you define a Layer 7 - HTTP or HTTPS Service on the BASIC > Services page, click Rule in the Add field to open the Content Rule page.
A content rule consists of three patterns, host, URL, and extended match.
If there are multiple rules for a service, each element of an incoming request is matched against each element of the content rules in the following sequence:
- Host
- URL
- Extended match
First an attempt is made to match the request against the host specified in each content rule. Next, an attempt is made to match the URL. Last, an attempt is made to match against the Extended Match. Once a match is made, the content rule is executed.
For example, if a Service has the following three rules:
- Rule A -
host * URL: /xyz/123.htm extended match: *
- Rule B -
host * URL: /* extended match: *
- Rule C -
host .abc.com URL: / extended match: *
And the Load Balancer receives a request for www.abc.com/xyz/123.html
. Rule C is the rule executed, because Rule C has the most specific match for the host request.
Here is another example. This time the Service has the following two rules:
- Rule A -
host www.example.com URL /images/*
- Rule B -
host www.example.com URL /images/*.png
The Load Balancer receives a request is for www.example.com/images/x.png
. This time Rule B is executed because both the host pattern and the URL pattern are the most specific match for the request.
If a rule has the most specific host and URL for a request, any Extended Match expressions for that rule are evaluated in the order established by the Extended Match Order field. If the request does not match any Extended Match expression for the rule then the request is considered to have failed to match any rule.
On the BASIC > Services page, you also configure the Real Servers that process the traffic matching the rule.