当前位置: 首页 > 工具软件 > varnish-agent > 使用案例 >

varnish-4.x VCL之User-Agent

阎英朗
2023-12-01
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";
    }
}


转载于:https://www.cnblogs.com/lixuebin/p/10814112.html

 类似资料: