-
-
Save dimobelov/13b9d4d4d5442965cb9e40a95bc42a50 to your computer and use it in GitHub Desktop.
Serving WEBP with nginx conditionally.
This file contains 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 characters
location ~* ^/images/.+\.(png|jpg)$ { | |
root /home/www-data; | |
add_header Vary Accept; | |
try_files "${uri}.webp" $uri =404; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment