added use SSL on purge requests option
[varnish-caching-wordpress-plugin.git] / varnish-conf / v5 / lib / mobile_pass.vcl
Razvan Stanga 1 # mobile_pass.vcl -- Mobile pass-through support for Varnish
2
3 # This simply bypasses the cache for anything that looks like a mobile
4 # (or tablet) device.
5 # Also passes through some requests that are specifically for the WordPress
6 # Jetpack mobile plugin.
7
8 sub vcl_recv {
9 # Rules specifically for the Jetpack Mobile module
10 if (req.url ~ "\?(.*&)?(ak_action|app-download)=") {
11 return(pass);
12 }
13 if (req.http.Cookie ~ "(^|;\s*)akm_mobile=") {
14 return(pass);
15 }
16
17 # General User-Agent blacklist (anything that remotely looks like a mobile device)
18 if (req.http.User-Agent ~ "(?i)ipod|android|blackberry|phone|mobile|kindle|silk|fennec|tablet|webos|palm|windows ce|nokia|philips|samsung|sanyo|sony|panasonic|ericsson|alcatel|series60|series40|opera mini|opera mobi|au-mic|audiovox|avantgo|blazer|danger|docomo|epoc|ericy|i-mode|ipaq|midp-|mot-|netfront|nitro|pocket|portalmmm|rover|sie-|symbian|cldc-|j2me|up\.browser|up\.link|vodafone|wap1\.|wap2\.") {
19 return(pass);
20 }
21 }
22
comments