Magento Cloud
Fastly CDN is available in staging and production environments.
To setup traffic split using Fastly, please ensure you are using the latest Fastly CDN for Magento module and verify that Fastly CDN is properly configured following the official documentation.
1
3
4
5
Create two new VCL snippets
Under Custom VCL Snippets create two new VCL snippets.
Make sure to replace GLOPAL_HOSTNAME
and GLOPAL_SECRET
placeholders with the value you receive from Glopal and that PATTERN
is a regular expression describing list of in-scope paths you want to delegate to Glopal.
vcl_recv snippet
Name: Glopal recv Type: recv Priority: 100
if ( req.restarts == 0 ) {
remove req.http.X-GlopalOrigin;
}
# Forward target to Glopal
if ( req.url.path ~ "^/()($|[:/?])" ) {
set req.http.X-GlopalOrigin = "1";
set req.http.X-Forwarded-Host = req.http.Host;
}
# Whitelist when Glopal is fetching source
if ( req.http.X-Glopal == "" ) {
set req.http.x-sigsci-no-inspection = "disabled";
}
vcl_backend_fetch snippet
Name: Glopal backend_fetch Type: backend_fetch Priority: 100
if ( bereq.http.X-GlopalOrigin ) {
set bereq.http.Host = "";
unset bereq.http.X-GlopalOrigin;
}
Documentation reference
Last updated