Home » Fastly : How to set basic authentication for a specific page in Magento 2
Fastly : How to set basic authentication for a specific page in Magento 2

Fastly : How to set basic authentication for a specific page in Magento 2

Post navigation

2 Comments

  • Hi,

    if (req.url.path == “/test-page” &&
    !req.http.Authorization ~ “Basic YWRtaW46cGFzc3dvcmQxMjM=”) {
    return (synth(401, “Unauthorized”));
    }

    This is not working even it is not saving as VCL validation throwing error when trying to upload VCL to fastly. Is there any extra configuration required ?
    Adobe Commerce Version 2.4.7-p4

    • Please try this one.

      sub vcl_recv {
      if (req.url.path == “/test-page” &&
      !req.http.Authorization ~ “Basic YWRtaW46cGFzc3dvcmQxMjM=”) {
      return (synth(401, “Unauthorized”));
      }
      }

Leave a Reply

Your email address will not be published. Required fields are marked *

How to Enable Maintenance Mode in Magento 2?

Enabling maintenance mode in Magento 2 is a crucial step when performing updates or troubleshooting your store. This mode allows you to take your site offline temporarily, ensuring that customers don't encounter issues during your work. In this guide, we'll walk you through the process of enabling and disabling maintenance mode, and show you how to exclude specific IP addresses for testing.
back to top