Welcome! Log In Create A New Profile

Advanced

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

November 07, 2019 10:30PM
Все, разобрался, получилось так
location / {
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @apacheback;
}
location ~* ^.+\.(gif|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf|woff|woff2|ico|ttf|eot|otf|flv)$ {
try_files $uri $uri/ @fallback;
expires 365d;
}
location ~* ^.+\.(jpg|jpeg|png)$ {
set $ax 0;
if ( $http_accept ~* "webp" ) {
set $ax 1;
}
if ( -e $root_path/webp$uri ){
set $ax "${ax}1";
}
if ($http_cookie ~* "modx_admin" ) {
set $ax 0;
}
if ( $ax = "11" ) {
rewrite ^ /webp$uri last;
return 403;
}
expires 365d;
try_files $uri $uri/ @fallback;
}
location ^~ /webp/ {
types { } default_type "image/webp";
add_header Vary Accept;
expires 365d;
try_files $uri $uri/ @fallback;
}
location / {
try_files /does_not_exists @fallback;
}
}
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: 88
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