Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- location ~* ^(/.+)\.(jpg|jpeg|jpe|png|gif)$ {
- add_header Vary Accept;
- if ($http_accept ~* "webp"){
- set $imwebp A;
- }
- if (-f $request_filename.webp) {
- set $imwebp "${imwebp}B";
- }
- if ($imwebp = AB) {
- rewrite ^(.*) $1.webp final;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement