Created
March 27, 2020 17:58
-
-
Save thatryan/82c2017aede958a61172bf3f597a3b72 to your computer and use it in GitHub Desktop.
Revisions
-
thatryan created this gist
Mar 27, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ location ~* ^(/.+)\.(jpg|jpeg|jpe|png|gif)$ { add_header Vary Accept; if ($http_accept ~* "webp"){ set $imwebp A; } if (-f $request_filename.webp) { set $imwebp "${imwebp}B"; } if ($imwebp = AB) { rewrite ^(.*) $1.webp; } }