How Does vcl_error Work?



  • Udaya Kumar

    Hi Squee,

    We have a requirement  to redirect any requests only from or to

    I have tried various methods (vcl & error) in the fastly fiddle and did not work as per the requirement.

    Here is the magento2 website where we use Fastly CDN.


    Comment actions Permalink
  • Squee

    Hi Udaya,

    Thanks for reaching out. 

    We're happy to look at this with you, but I suspect we'll need more details to provide you with a solution. 

    As for the fiddle, the host on the fiddle is some variation on `exec<number>`. If you want to write VCL to be able to test redirects coming in from another host, try setting that host at the top of `vcl_recv`. That would look something like:

    set = "";

    You would only want to do this in the fiddle to create the testing environment you need. Please don't put this line in your code unless you intend to rewrite the host for your origin to find.

    If you have further questions, please don't hesitate to open a ticket with support by emailing

    Comment actions Permalink

Please sign in to leave a comment.