---
title: "Simplified VCL for Varnish"
date: "2025-02-05T23:21:50+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/92916-simplified-vcl-varnish"
id: "2ce6f99b-650b-4e96-ac8d-c61e44da5502"
---

### Issue

I would like to set up a local environment with Varnish to closely resemble what I have hosted. 

### Resolution

If you're using [Varnish](https://drupal.org/project/varnish), the following VCL file has helped some customers who are setting up local environments that closely resemble Acquia Cloud systems.

    backend default {
       .host = "127.0.0.1";
       .port = "8080";
       .connect_timeout = 2s;
    }
     
    sub vcl_recv {
      if (req.http.X-Forwarded-For) {
        set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " + client.ip;
      } else {
        set req.http.X-Forwarded-For = client.ip;
      }
      if (req.request != "GET" && req.request != "HEAD") {
        return(pass);
      }
      if(req.url ~ "^/cron.php") {
        return(pass);
      }
      if(req.url ~ "^/xmlrpc.php") {
        return(pass);
      }
      if (req.http.Authorization) {
        return(pass);
      }
      if(req.http.cookie ~ "(^|;\s*)(SESS=)") {
        return(pass);
      }
      return(lookup);
    }

This is a basic example. If you have other needs or tests you want to perform, we suggest that you visit the [VCL examples](https://docs.varnish-software.com/varnish-live/vcl_example/) page, which includes several real-world examples of VCL that you can use for reference. Note that the session cookie can start with SSESS and SESS.