nginx的http_sub_module/sub_filter和反向代理无法正常工作

我试图反向代理我的网站并修改内容.
为此,我使用sub_filter编译了nginx.
它现在接受sub_filter指令,但它不能以某种方式工作.

server {
    listen       8080;
    server_name  www.xxx.com;

    access_log  /var/log/nginx/www.goparts.access.log  main;
    error_log  /var/log/nginx/www.goparts.error.log;
    root   /usr/share/nginx/html;
    index  index.html index.htm;

    ## send request back to apache1 ##
    location / {
       sub_filter 

请帮我
最佳答案
检查上游源是否已打开gzip,如果需要,请执行此操作

proxy_set_header Accept-Encoding "";

所以整个事情都会像

location / {
    proxy_set_header Accept-Encoding "";
    proxy_pass http://upstream.site/;
    sub_filter_types text/css;
    sub_filter_once off;
    sub_filter .upstream.site special.our.domain;
}

检查这些链接

> https://www.ruby-forum.com/topic/178781
> https://forum.nginx.org/read.php?2,226323
> http://www.serverphorums.com/read.php?5,542078

dawei

【声明】:淮南站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。