To optimize the site used the storage of images in the additional format .webp . The point is this: the user requests a picture image.jpg (in the browser), the web server looks, if there is such a picture in the .webp format and the browser supports, then it gives it. Used solution on .htaccess :
https://github.com/vincentorback/WebP-images-with-htaccess
And everything works fine, but on the local, I only have Apache (xampp), but there is a problem with the production server, there is a bunch of Apache and nGinx on the dedicated server, the solution does not work through .htaccess , I don’t understand the servers much, but So I understand that the site’s static is given by nGinx , and hence the question: How can I configure nGinx so that the image substitution on .webp as I wrote above?