yaoweibin / ngx_http_substitutions_filter_module

a filter module which can do both regular expression and fixed string substitutions for nginx
607 stars 213 forks source link

Why can't I substitute the text ? #22

Closed LarryLuTW closed 7 years ago

LarryLuTW commented 7 years ago

This is my config file:

        location / {
            # access_log /var/log/nginx/access.log main;
            # access_log on;
            proxy_pass https://www.facebook.com;
            proxy_redirect off;
            subs_filter facebook aaa;

            # proxy_set_header   Host             $host;
            # proxy_set_header   X-Real-IP        $remote_addr;
            # proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        }

I am using nginx on localhost. When I go to http://localhost:8080/, It shows Facebook homepage. I want to use subs_filter to replace 'facebook' with 'aaa', but It doesn't work. Is there any where I'm wrong ?

bAndie91 commented 7 years ago

proxy_set_header Accept-Encoding identity ?

LarryLuTW commented 7 years ago

Thanks, it works.