webmreplace
This commit is contained in:
@ -21,8 +21,14 @@ server {
|
|||||||
add_header Cache-Control "public, no-transform";
|
add_header Cache-Control "public, no-transform";
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~* \.(?:png|jpe?g)(\?.+)?$ {
|
# Capture image path, without the file extension
|
||||||
try_files $uri$webp_suffix $uri =404;
|
map $uri $image {
|
||||||
|
~*^/(assets)/(.+)\.(jpe?g|png)$ /$1/$2;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /assets {
|
||||||
|
add_header Vary Accept;
|
||||||
|
try_files $image$webp_suffix $uri =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_page 404 /404.html;
|
error_page 404 /404.html;
|
||||||
|
Reference in New Issue
Block a user