This commit is contained in:
Steffen Illium
2023-12-24 15:22:21 +01:00
committed by Steffen Illium
parent 033fc3840b
commit 0b418f0d41

View File

@ -1,10 +1,10 @@
map $http_accept $webp_suffix { # map $http_accept $webp_suffix {
default ""; # default "";
"~*webp" ".webp"; # "~*webp" ".webp";
} # }
types { # types {
image/webp webp; # image/webp webp;
} # }
server { server {
listen 80; listen 80;
@ -22,10 +22,10 @@ server {
add_header Cache-Control "public, no-transform"; add_header Cache-Control "public, no-transform";
} }
location ~* ^.+\.(png|jpg|jpeg)$ { # location ~* ^.+\.(png|jpg|jpeg)$ {
add_header Vary Accept; # add_header Vary Accept;
try_files $uri$webp_suffix $uri =404; # try_files $uri$webp_suffix $uri =404;
} # }
error_page 404 /404.html; error_page 404 /404.html;