Some images not served as WebP on nginx
-
Hello,
The test image is green with the text WEBP. This is in nginx.cof:
map $http_accept $webp_ext { default ""; "~*webp" ".webp"; }
This is in the server block:
location ~* ^/wp-content/.+\.(png|jpe?g)$ { add_header Vary Accept; try_files $uri$webp_ext $uri/ =404; }
Should it matter if I put ‘jpg’ or ‘jpg|jpeg’ or like above ‘png|jpe?g’?
In any case, it has to be before this to work:location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { access_log off; log_not_found off; expires max; }
But does that mean that it won’t set ‘expires max’ to jpeg and png at all?
The problem is that some jpegs are served as text/html and generates 404. What could be the of cause this?
Cheers,
Gabriel
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘Some images not served as WebP on nginx’ is closed to new replies.