Skip to content

Instantly share code, notes, and snippets.

View dbarbar's full-sized avatar

David Barbarisi dbarbar

View GitHub Profile
@dbarbar
dbarbar / mobile-detect.vcl
Created October 8, 2012 00:13 — forked from elidickinson/mobile-detect.vcl
Varnish config for user agent sniffing
# This file has been modified by Eli Dickinson to update detection rules and to
# send a Vary header downstream. It has also been updated to
# work with newer versions of Varnish.
#
# A simple mobile device detection implementation in VCL
# http://fangel.github.com/mobile-detection-varnish-drupal
#
# The file is based upon initial work done by Audun Ytterdal, which can be
<?php
$path = CWD;
$site_dir = NULL;
$dpl_dir = NULL;
while ($path != '/') {
if (file_exists($path . '/settings.php')) {
$site_dir = $path;