Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Block request on Fastly CDN

Avatar

Level 3

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....

1 Accepted Solution

Avatar

Correct answer by
Level 4

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;
}

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/edge-delivery/la...

View solution in original post

5 Replies

Avatar

Community Advisor

Yes, it is possible to set the 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. Please refer to the URLs below for more details.

Traffic Filter Rules including WAF Rules | Adobe Experience Manager

A Deep Dive into CDN Capabilities Within AEM as a Cloud | by Albin Issac | Tech Learnings | May, 202...

Regards

Albin

https://myprofile.albinsblog.com

Avatar

Correct answer by
Level 4

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;
}

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/edge-delivery/la...