Created
July 16, 2019 07:59
-
-
Save markonikolic985/760cecdaa51c6143c11dd7452236132f to your computer and use it in GitHub Desktop.
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
# 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 $1$webp_ext $uri =404; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment