本质就是实现反向代理内容替换,示例代码在下面。

Nginx:

subs_filter "A" "B" ir;

相关链接:https://www.nginx.com/resources/wiki/modules/substitutions/

Apache:

<Location "/">
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s/foo/bar/ni"
</Location>

相关链接:http://httpd.apache.org/docs/2.4/mod/mod_substitute.html

Related Posts: Nginx Apache subs_filter示例 :