Yefei.Blog

个人日记 WIKI

用户工具

站点工具


nginx:proxy-substr

代理并替换内容

代理目标网站,并替换HTML内容

server {
  listen 89;
  root /media/sf_work/test;
  try_files $uri $uri/index.html @p;

  location @p {
    proxy_pass http://www.test.com;
    proxy_set_header Host www.test.com;
    proxy_set_header Referer http://www.test.com;
    proxy_set_header Accept-Encoding "";
    proxy_redirect off;
    sub_filter 'href="' 'href="https://www.aaa.com/#';
    sub_filter_once off;
    sub_filter_types text/html;
  }
}
nginx/proxy-substr.txt · 最后更改: 2018/06/04 15:14 由 yefei