我想删除清漆VCL授权头,但也需要这个头被发送到后端为好。
sub vcl_recv {
unset req.http.Authorization;
}
它看起来像一个坏主意,但它使用一些基本的VCL是绝对可行的。例如:
sub vcl_recv {
if (req.http.Authorization) {
set req.http.Authorization-Copy = req.http.Authorization;
unset req.http.Authorization;
} else {
unset set req.http.Authorization-Copy;
}
}
sub vcl_backend_fetch {
if (bereq.http.Authorization-Copy) {
set bereq.http.Authorization = bereq.http.Authorization-Copy;
unset bereq.http.Authorization-Copy;
}
}