현재 일반 캐시 용으로 설정 한 바니시뿐 아니라 웹 사이트 모바일 버전의 리디렉션 역할을합니다.리디렉션에 일치하는 VCL 및 Req.Url
잘 작동하며 (Varnish처럼!) 의도 한대로 리디렉션됩니다. 모바일을 사이트의 모바일 버전으로 리디렉션하는 것뿐만 아니라 모바일 사이트 (예 : Google)의 링크에 액세스하는 데스크톱을 사이트의 데스크톱 버전으로 리디렉션하기 위해 VCL 구성에 기능을 추가하기로 결정했습니다.
그러나 나는 이것이 가장 수수께끼 같은 방식으로 작동하지 않을 수 있습니다. 여기 VCL입니다 : 특정 공유 자산 를 무시
# 경우 (! ". (JPG | PNG | GIF | GZ | TGZ | BZ2 | TBZ | MP3 | 오그 | CSS) $"req.url ~) {
# Let's detect if we're a Mobile
if (req.http.User-Agent ~ "iP(hone|od)" || req.http.User-Agent ~ "Android" || req.http.User-Agent ~ "Symbian" || req.http.User-Agent ~ "^BlackBerry" || req.http.User-Agent ~ "^SonyEricsson" || req.http.User-Agent ~ "^Nokia" || req.http.User-Agent ~ "^SAMSUNG" || req.http.User-Agent ~ "^LG" || req.http.User-Agent ~ "webOS" || req.http.User-Agent ~ "^PalmSource") {
# If we're a mobile, set the X-Device header.
set req.http.X-Device = "mobile";
# If we've not set a preference to the fullsite to override the redirect, and we're not accessing the mobile site, redirect. This all works fine.
if ((req.http.Cookie !~ "fullsite")&&(req.url !~ "mobile")){
error 750 "Moved Temporarily";
}
}
else{
# We're not mobile. I can see this header is set in the logs.
set req.http.X-Device = "desktop";
# If we're a desktop AND accessing the mobile site....
if (req.url ~ "mobile"){
# -------------------- THIS NEVER HAPPENS
error 750 "Moved Temporarily";
}
}
}
여기 논리에 눈부신 오류가 있습니까? 내가 볼 수있는 리디렉션을 방해 할 수있는 쿠키 나 다른 것들은 없습니다. 누구든지 여기에 대한 통찰력을 가지고 있다면, 나는 :) 안부 B 나는 사람이 같은 문제로 이것을 읽고 넣다 방문 것