Hi @wordonpress,
Thank you for your message. Yes, I have settings to configure nginx.
Please edit the configuration file:
/etc/nginx/mime.types
and add this code:
types {
# ...
image/webp webp;
}
Then please find your configuration file in the path (default is default file):
/etc/nginx/sites-available/
and add below code in this file:
server {
# ...
location ~ (?<root>.+)/uploads/(?<path>.+)\.(?<ext>jp?g|png|gif)$ {
if ($http_accept !~* "image/webp") {
break;
}
add_header Vary Accept;
expires 365d;
try_files $root/uploads-webpc/$path.$ext.webp $uri =404;
}
}
Let me know if it works for you. I will be grateful for feedback!
@wordonpress, I am happy to.
In that case, can I ask you to add a review? I will be very grateful!