One rule, two matches, one behavior

In this example, we show a working base configuration that incorporates a single rule that has been set up with two match criteria that can be met to apply a single behavior.

In this example, the following are set:

  • Match Criteria: The URI extension must be “jpg,” “gjf,” or “png” and the request method must be GET.
  • Behavior: If the match criteria is met, an IP whitelist is applied, denying all IPs except 198.18.48.211 and 198.18.48.212 access to these objects using the GET method.
{ 
    "rules" : [
        {
            "matches" : [
                {
                    "name" : "url-extension",
                    "value" : "jpg gif png"
                },
                {
                    "name" : "http-method",
                    "value" : "GET"
                }
            ],
            "behaviors" : [
                {
                    "name" : "ip-whitelist",
                    "value" : "198.18.48.211 198.18.48.212"
                }
            ]
        }
    ]
}