We use cookies on our website to ensure we provide you with the best experience on our website. By using our website, you agree to the use of cookies for analytics and personalized content.This website uses cookies. More Information
It seems like your browser didn't download the required fonts. Please revise your security settings and try again.
Barracuda Load Balancer

Understanding Content Rules

  • Last updated on
You can create content rules to specify how an HTTP request is directed to one or more Real Servers based on the URL or Header fields of an incoming request.
If a request does not match any content rule, it is directed to the Service's Real Servers.

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:

  1. Host
  2. URL
  3. 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.

For details on Extended Match and Condition expressions, see How to Use Extended Match and Condition Expressions.

For information on Redirect Rules, see Understanding Redirect Rules.

Last updated on