我无法使用 Nginx 获取 webp 文件。虽然我做了各种设置,图片类型还是显示为png或者jpg。我哪里出错了?
map $http_accept $webp_ext {
default "";
"~*webp" ".webp"; }
location ~* ^/?wwwroot/.*\.(png|jpe?g)$ {
add_header Vary "Accept-Encoding";
access_log off;
log_not_found off;
expires max;
try_files $uri$webp_ext $uri =404;
}