Block request on Fastly CDN
Is there any configuration on Fastly CDN to block the request on Fastly itself from hitting my AEM publisher or dispatcher?? It is to do with AEM Sites not with Commerce....
Is there any configuration on Fastly CDN to block the request on Fastly itself from hitting my AEM publisher or dispatcher?? It is to do with AEM Sites not with Commerce....
Hi @bhavigoyal
Yes, it is possible to set traffic filter rules, including rate limits, in AEM as a Cloud OOTB Fastly CDN. Some of the advanced WAF-based rules require an additional WAF or advanced security license, but the basic filter rules can be used OOTB.
You can create VCL snippets for the recv subroutine with the following VCL code:
if (req.url.path !~ "/media_[0-9a-f]{40,}[/a-zA-Z0-9_-]*\.[0-9a-z]+$"
&& req.url.ext !~ "(?i)^(gif|png|jpe?g|webp)$"
&& req.url.ext != "json"
&& req.url.path != "/.auth") {
// strip query string from request url
set req.url = req.url.path;
}
if (req.url.path !~ "/media_[0-9a-f]{40,}[/a-zA-Z0-9_-]*\.[0-9a-z]+$"
&& req.url.ext !~ "(?i)^(gif|png|jpe?g|webp)$"
&& req.url.ext != "json"
&& req.url.path != "/.auth") {
// strip query string from request url
set req.url = req.url.path;
}
set bereq.http.X-BYO-CDN-Type = "fastly";
set bereq.http.X-Push-Invalidation = "enabled";
This code enables the push invalidation including long cache TTLs.
You can also create a deliver snippet with the following VCL code:
unset resp.http.Age;
if (req.url.path !~ "\.plain\.html$") {
unset resp.http.X-Robots-Tag;
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.