Created
December 16, 2016 02:32
-
-
Save Kaiderella/d138d899ce57cacd751621bd7d06b2c9 to your computer and use it in GitHub Desktop.
Kích hoạt WebP cho NginX
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 $uri$webp_ext $uri =404; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment