クライアントの URL "www.example.com/download.." を "one.other.com/download..." に操作したいのですが、クライアントの URL で最初の "www.example.com/download "
Varnish 3 でこれを行う方法はありますか??
クライアントの URL "www.example.com/download.." を "one.other.com/download..." に操作したいのですが、クライアントの URL で最初の "www.example.com/download "
Varnish 3 でこれを行う方法はありますか??
regsub()
はい、 VCLの関数を使用して簡単に実行できますvcl_recv
。
例えば:
if (req.http.host ~ "^(www\.)?example\.com" && req.url~ "^/download/") {
set req.http.host = "one.other.com";
set req.url = regsub(req.url, "^/download/", "/");
}
http://www.example.com/download/example.jpg
この例では、へ のアクセスを書き換えます http://one.other.com/example.jpg
。もちろん、ユーザーには見えません。