Created
May 24, 2020 12:30
-
-
Save reatlat/ff1577845e6840430e2ba59dceec6385 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 { | |
| [...] | |
| # webp support | |
| # see: https://docs.ewww.io/article/16-ewww-io-and-webp-images | |
| map $http_accept $webp_suffix { | |
| default ""; | |
| "~*webp" ".webp"; | |
| } | |
| server { | |
| [...] | |
| location ~* ^.+\.(png|jpe?g)$ { | |
| ### Please change the domainname before uncommenting the following | |
| # valid_referers none blocked www.example.com example.com; | |
| # if ($invalid_referer) { return 403; } | |
| # add_header Vary Accept; | |
| # see https://docs.ewww.io/article/16-ewww-io-and-webp-images | |
| try_files $uri$webp_suffix $uri =404; | |
| expires max; | |
| log_not_found off; | |
| access_log off; | |
| } | |
| [...] | |
| } | |
| [...] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment