I want to use EWWW Image Optimizer to convert all graphics to WebP format on my wordpress websites.
Refer to the EWWW documentation (EWWW IO and WebP Images - EWWW I.O. Documentation), I have to do these things:
next
and then
Is it safe? Do automatic updates from Plesk do not overwrite these settings?
Refer to the EWWW documentation (EWWW IO and WebP Images - EWWW I.O. Documentation), I have to do these things:
First, we need to add a map directive to your global config, usually /etc/nginx/nginx.conf:
map $http_accept $webp_suffix {
default "";
"~*webp" ".webp";
}
next
Modify the mime.types file (also in /etc/nginx/) to tell Nginx about this new file type. Look for this line, and add it if you can't find it:
image/webp webp;
and then
The last change is to setup a location block within your server block to handle PNG and JPG images that might have WebP versions. If you only have one server block, it is usually located in /etc/nginx/sites-enabled/default. Add this within the server {} section:
location ~* ^.+\.(png|jpe?g)$ {
add_header Vary Accept;
try_files $uri$webp_suffix $uri =404;
}
Is it safe? Do automatic updates from Plesk do not overwrite these settings?
Last edited: