server { listen [300:529f:150c:eafe::7]:80; #установка заголовков, которые позволят понять серверу, что запросы пришли через прокси-сервер proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; sub_filter_once off; #нужно заменять все совпадения, не только первое sub_filter_last_modified on; #сохранение поля Last-Modified в исходном ответе location / { proxy_set_header Accept-Encoding ""; # сообщаем серверу, что данные не нужно сжимать, иначе не будут работать фильтры sub_filter sub_filter "https://static.smi2.net/" "$scheme://$host/staticsmi2net/"; sub_filter "//smi2.ru/" "//$host/smi2ru/"; sub_filter "https://www.interfax.ru/" "$scheme://$host/"; sub_filter "https://fonts.googleapis.com/" "$scheme://$host/ftsgapis/"; sub_filter "https://cdn.onthe.io/" "$scheme://$host/cdnontheio/"; #обрезаем лишнее sub_filter "https://yastatic.net" "$scheme://$host/_empty"; sub_filter "//www.googletagmanager.com/" "//$host/_empty"; sub_filter "/js/prebid.min.js" "/_empty"; sub_filter "https://static.videonow.ru/" "$scheme://$host/_empty"; sub_filter "https://stats2.videonow.ru/" "$scheme://$host/_empty"; sub_filter "https://cdn.videonow.ru/" "$scheme://$host/_empty"; sub_filter "http://imasdk.googleapis.com/" "$scheme://$host/_empty"; sub_filter "https://s0.2mdn.net/" "$scheme://$host/_empty"; sub_filter "" "" "/ tns-counter.ru -->"; sub_filter "" "" "/Yandex.Metrika counter -->"; sub_filter "" "" " /Global site tag (gtag.js) - Google Analytics -->"; sub_filter "" "" "/noindex-->"; sub_filter "containerId: '" "containerId: '-"; sub_filter "/css/ads.css" "/_empty"; sub_filter "cntimg.src = \"/cnt/\" + cntParseReferer()" "cntimg.src = \"/_empty\""; #скроем ненужные элементы sub_filter "class=\"toplinks\"" "style=\"visibility: hidden;\""; sub_filter "class=\"header__soc\"" "style=\"visibility: hidden;\""; sub_filter "class=\"but__enter\"" "style=\"visibility: hidden;\""; sub_filter "