Welcome! Log In Create A New Profile

Advanced

Проксирование nginx. Sub_filter и внешний скрипт

February 07, 2017 07:32AM
Как с помощью sub_filter фильтровать содержимое внешнего скрипта?

Допустим есть страница:

<body>
<script src="http://arcanumclub.ru/js/fantazy.js"> </script>
</body>


fantazy.js :

var o = {};o.bgcolor = "#d2b48c";o.height = "130";o.width = "155"......

Хочу в скрипте заменить "bgcolor" на "1111111111"

Конфиг виртуального хоста:

server {
listen 80;
server_name aaaaaa.ru;

location / {
proxy_pass [url]http://arcanumclub.ru;[/url]
proxy_set_header Accept-Encoding "";

sub_filter 'bgcolor' '1111111111';
sub_filter_once off;
sub_filter_types *;
}}

Подменить слова в HTML документе удается, а вот во внешнем скрипте - нет(((

Чувствую, что проблема как-то связана с HTTP headers или GZIP, но понять не могу (только начал изучать nginx).

nginx 1.10.2
--with-http_sub_module
Subject Author Posted

Проксирование nginx. Sub_filter и внешний скрипт

san_ February 07, 2017 07:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 283
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready