我想删除清漆vcl中的Authorization标头,但也需要将此标头发送到后端。
sub vcl_recv {
unset req.http.Authorization;
}
答案 0 :(得分:0)
这似乎是个坏主意,但是使用一些基本的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;
}
}