openresty / replace-filter-nginx-module

Streaming regular expression replacement in response bodies
260 stars 68 forks source link

Not working when try to match script tag in html #25

Open guorenxi opened 6 years ago

guorenxi commented 6 years ago

The Text:

The Regex Expression: <script.slick.>.*

The Conf:

location / {

proxy_ssl_server_name on;

        proxy_connect_timeout 60s;
        proxy_read_timeout 5400s;
        proxy_send_timeout 5400s;
        proxy_pass http://xxx.net/;
        proxy_ssl_verify off;
        #proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host "xxx.net";
        proxy_set_header User-Agent $http_user_agent;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Accept-Encoding '';
        replace_filter '<script.*slick.*>.*</script>' '' g;
        replace_filter_max_buffered_size 1024k;
    }

Nginx Version nginx/1.14.0

Please help.

Thanks.