我正在尝试根据响应标头缓存请求。现在我想要的条件是如果响应同时具有 2 个标头 client-device 和 client-location,那么响应应该缓存在 nginx 端
所以我尝试使用这段代码
if ($http_client_device && $http_clocation) {
set $cache_key "$request_uri$http_client_device$http_client_location";
}
proxy_cache_key $cache_key;
Run Code Online (Sandbox Code Playgroud)
但 nginx 不允许 nginx: [emerg] 意外的“&&”条件...
无论如何要解决这个问题吗?提前致谢