Welcome! Log In Create A New Profile

Advanced

Re: Замена content-type image/webp в location

November 07, 2019 03:29AM
Здравствуйте!

На первый взгляд у вас переусложнённый конфиг для отдачи webp.
Предлагаю посмотреть готовую схему, где этих проблем нет: https://www.youtube.com/watch?v=CI3Y8NYdZXM
Там на уровне сервера определяется поддержка webp и потом уже используется в локейшене.

В Nginx.conf:

map $http_accept $webp_suffix {
"~*webp" ".webp";
}

map $msie $cache_control {
default "max-age=31536000, public, no-transform, immutable";
"1" "max-age=31536000, private, no-transform, immutable";
}

map $msie $vary_header {
default "Accept";
"1" "";
}

В конфе сервера:

# Static files location
location ~* \.(jpg|jpeg|gif|png)$ {
add_header Vary $vary_header;
add_header Cache-Control $cache_control;
try_files $uri$webp_suffix $uri =404;
}
Subject Author Posted

Замена content-type image/webp в location

commeta November 06, 2019 04:44PM

Re: Замена content-type image/webp в location

Илья Шипицин November 06, 2019 04:54PM

Re: Замена content-type image/webp в location

commeta November 06, 2019 06:19PM

Re: Замена content-type image/webp в location

NickLavlinsky November 07, 2019 03:29AM

Re: Замена content-type image/webp в location

commeta November 07, 2019 07:53AM

Re: Замена content-type image/webp в location

damir bikmuhametov November 07, 2019 08:30AM

Re: Замена content-type image/webp в location

Илья Шипицин November 07, 2019 08:30AM

Re: Замена content-type image/webp в location

commeta November 07, 2019 08:21PM

Re: Замена content-type image/webp в location

commeta November 07, 2019 10:30PM

Re: Замена content-type image/webp в location

damir bikmuhametov November 07, 2019 10:26PM

Re: Замена content-type image/webp в location

vitcool November 07, 2019 08:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 370
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready