Created
August 8, 2012 14:17
-
-
Save tdonia/3295367 to your computer and use it in GitHub Desktop.
varnish mobile filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rutine to try and identify device | |
sub identify_device { | |
# Default to thinking it's a PC | |
set req.http.X-Device = "pc"; | |
if (req.http.User-Agent ~ "iP(hone|od)" || req.http.User-Agent ~ "Android" ) { | |
# It says its a iPhone, iPod or Android - so let's give them the touch-site.. | |
set req.http.X-Device = "mobile"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment