Filter by Route

In case you don’t want to enforce your entire website topology, you can filter out specific routes using the Filter by Route feature.

TO define filtered routes:

  1. Open the PX_CUSTOM.vcl fie.
  2. Add the required routes as a regex expression using req.url.path.

EXAMPLE

sub px_custom_filter_by_route {
   if (req.url.path ~ {"^/prefix|^/exact/match$"}) {
      set req.http.X-PX-filter-by:route = "1";
   }
}

To learn more about custom subroutines, see Customized subroutines.

TO enable the feature:

v8.0.0 and up

  1. Open the PX_CONFIG.vcl file.
  2. Set the px_filter_by_route_enabled value to "true" (enabled). The default is "false" (disabled).
table px_configs {
  "px_filter_by_route_enabled": "true",
}

v7.2.0 and below

  1. Open the PX_CONFIG.vcl file.
  2. Set the ENABLE_WHITELISTED_ROUTES value to "1" (enabled). The default is "0" (disabled).
table px_configs {
  "ENABLE_WHITELISTED_ROUTES": "1",
}

📘

Test

  1. Send a request to one of the defined routes.
  2. Openthe console and search for your request. If you can't find the request, the feature is configured correctly.