Created
May 31, 2016 18:44
-
-
Save amElnagdy/bfc0844a869cb4561764f683ced1a68b to your computer and use it in GitHub Desktop.
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 characters
# http config block | |
map $http_accept $webp_ext { | |
default ""; | |
"~*webp" ".webp"; | |
} | |
# server config block | |
location ~* ^/wp-content/.+\.(png|jpg)$ { | |
add_header Vary Accept; | |
try_files $uri$webp_ext $uri =404; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment