• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue WebP and nginx in reverse proxy

LorisMod

New Pleskian
Hello,

PHP run FPM by Apache, Nginx in Proxy mode

Screenshot_19.jpg

Screenshot_18.jpg

I tried to configure it like this, in etc/nginx/ nginx.conf i added in http:
map $http_accept $webp_suffix {
default "";
"~*webp" ".webp";
}

In Additional nginx directives
location ~* ^.+\.(png|jpe?g)$ {
add_header Vary Accept;
try_files $uri$webp_suffix $uri =404;
}

But PNG and JPG images with URL not rewritten by Apache, are not served as webp

Original image: https://beta.demomodule.com/img/cms/cms-img.jpg
WebP Image: https://beta.demomodule.com/img/cms/cms-img.webp

webp-not.jpg
In the mime.types file webp is present.

Test Web Site: TEST DEMO
 

Attachments

  • htaaccess.zip
    1.7 KB · Views: 2
Back
Top