varnish-4.x VCL之User-Agent

varnish-4.x VCL之User-Agent



示例:
sub vcl_recv {
    if (req.http.User-Agent ~ "iPad" ||
        req.http.User-Agent ~ "iPhone" ||
        req.http.User-Agent ~ "Android") {
        set req.http.X-Device = "mobile";
    } else {
        set req.http.X-Device = "desktop";
    }
}
相關文章
相關標籤/搜索