示例12:为nginx添加新的文件类型

示例12:为nginx添加新的文件类型,nginx,plesk,Nginx,Plesk,我的Plesk 12使用Apache+nginx。现在我使用webp,这些不是由nginx提供的,而是由Apache提供的 如何将webp添加到nginx的文件类型列表中 /etc/nginx/mime.types在其图像块中有webp,如下所示: types { image/png png; image/tiff tif tiff; image/vnd.wap.

我的Plesk 12使用Apache+nginx。现在我使用webp,这些不是由nginx提供的,而是由Apache提供的

如何将webp添加到nginx的文件类型列表中

/etc/nginx/mime.types
在其图像块中有webp,如下所示:

types {
    image/png                             png;
    image/tiff                            tif tiff;
    image/vnd.wap.wbmp                    wbmp;
    image/x-icon                          ico;
    image/x-jng                           jng;
    image/x-ms-bmp                        bmp;
    image/svg+xml                         svg svgz;
    image/webp                            webp;
}

编辑:在我的Apache设置中,通过重写规则jpg>webp提供webp

我只需编辑您的nginx.conf:,然后重新启动服务(或者,最好重新启动Plesk VM)。也见,嗯。在我的Apache设置中,通过重写规则jpg>webp为webp提供服务。我只需编辑nginx.conf:,然后重新启动服务(或者更好地重新启动Plesk VM)。也见,嗯。在我的Apache设置中,通过重写规则jpg>webp提供webp。