Varnish Module for AWS with Haproxy

Daniel Faria



7,179 latest version

1.5 quality score

Version information

  • 0.1.5 (latest)
  • 0.1.0
released Sep 12th 2015

Start using this module


danielfnfaria/varnish — version 0.1.5 Sep 12th 2015


Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with varnish
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.


This module will help you manage varnish servers with a standard template of what can happen it will create its VCL files simply.

Module Description

Control of:

  • Varnish
  • Haproxy

To run on AWS structure CNAME to your Load Balancers


What varnish affects

Basically controlled files are:

  • /etc/varnish/default.vcl + VCL's additional
  • /etc/varnish/secret
  • /etc/sysconfig/varnish
  • /etc/haproxy/haproxy.conf

Setup Requirements OPTIONAL

Require module concat

Beginning with varnish

The very basic steps needed for a user to get the module up and running.

If your most recent release breaks compatibility or requires particular steps for upgrading, you may wish to include an additional section here: Upgrading (For an example, see


git clone varnish


For add simple site:

  varnish::config {'site':
    host      => '',# Send connections for haproxy in localhost
    port      => '8000', # Default port haproxy
    vhost     => '',
    custom_lb => '', # Custom LB AWS CNAME

For especific cache:

   cache     => [
     { 'url' =>  '/home/index.html', 'time' => '120' }, # Time in seconds
     { 'url' =>  '^(.*)\.jpg$',      'time' => '60'},   # Accept POSIX regex

For no cache especific locations:

   nocache   => [


This module work's in Centos6 and Varnish 4, but the addition of debian is in development.


To help make a pull-request