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:
- Open the PX_CUSTOM.vcl fie.
- 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
- Open the PX_CONFIG.vcl file.
- 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
- Open the PX_CONFIG.vcl file.
- Set the ENABLE_WHITELISTED_ROUTES value to "1" (enabled). The default is "0" (disabled).
table px_configs {
"ENABLE_WHITELISTED_ROUTES": "1",
}
Test
- Send a request to one of the defined routes.
- Openthe console and search for your request. If you can't find the request, the feature is configured correctly.
Updated 12 days ago