diff --git a/global/server/static-files.conf b/global/server/static-files.conf index 7cc3f12..e4aba67 100644 --- a/global/server/static-files.conf +++ b/global/server/static-files.conf @@ -8,6 +8,12 @@ location ~* \.(?:rss|atom)$ { expires 1h; } +# Use the WebP version of converted PNG/JPEG images +location ~* ^.+\.(png|jpe?g)$ { + add_header Vary Accept; + try_files $uri$webp_suffix $uri =404; +} + # Caches images, icons, video, audio, HTC, etc. location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc|webp)$ { expires 1y;