test webp

This commit is contained in:
Steffen Illium 2024-05-06 23:13:37 +02:00
parent b0ebb691b7
commit 64ba429c49
2 changed files with 11 additions and 1 deletions

View File

@ -282,7 +282,7 @@ webp:
enabled: true
# The quality of the webp conversion 0 to 100 (where 100 is least lossy)
quality: 85
quality: 80
# List of directories containing images to optimize, nested directories will only be checked if `nested` is true
# By default the generator will search for a folder called `/img` under the site root and process all jpg, png and tiff image files found there.

View File

@ -1,8 +1,18 @@
map $http_accept $webp_suffix {
default "";
"~*webp" ".webp";
}
server {
listen 80;
listen [::]:80;
server_name localhost;
location ~* \.(?:jpg|jpeg|png|webp)$ {
root /usr/share/nginx/html;
try_files $uri$webp_suffix $uri = 404;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;