danangds

WebP support untuk Nginx

Jul 20th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.42 KB | None | 0 0
  1. # webp support untuk plugin ewww
  2. # see: https://docs.ewww.io/article/16-ewww-io-and-webp-images
  3. map $http_accept $webp_suffix {
  4.   default "";
  5.   "~*webp" ".webp";
  6. }
  7. location ~* ^.+\.(png|jpe?g)$ {
  8.  # see https://docs.ewww.io/article/16-ewww-io-and-webp-images
  9.  # untuk pengguna ewww plugin webp
  10.   add_header Vary Accept;
  11.   expires 31d;
  12.   try_files $uri$webp_suffix $uri =404;
  13.   log_not_found off;
  14.   access_log off;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment