nginx 反代的一个问题

2015-11-22 01:06:35 +08:00
 sky170
想用 sub_filter 把反代的谷歌右下角的“ Google.com in English ”替换为一个站长统计要如何做?
3191 次点击
所在节点    NGINX
13 条回复
feather12315
2015-11-22 01:38:33 +08:00
sub_filter 只能进行一次替换。
用法请搜索。我只举个例子:
把 HTML 页面中所有的 Google.com 替换为 some.com
sub_filter Google.com some.com
ryd994
2015-11-22 01:44:03 +08:00
sky170
2015-11-22 01:58:25 +08:00
反代是用 http://ttt.tt/162/ 这个方法搭建 ,要如何修改
feather12315
2015-11-22 02:26:04 +08:00
@sky170 直接用我写的 dockerfile 搭建吧。
我也是从这过来的,你需要份配置清单,一点点弄明白是什么意思。
https://github.com/time-river/time-river/tree/master/nginx/config/docker


@ryd994 这是知道的,只是 1.9 不是 stable version
Showfom
2015-11-22 02:36:00 +08:00
@sky170 我博客的教程哦,反代公开以后域名就被 DNS 污染了,所以。。。。
sky170
2015-11-22 02:44:00 +08:00
@Showfom 是啊,看了你的博客搭建的,然后我想知道要如何替换= =,我直接复制“ Google.com in English ”包括<a>标签的所有内容,可以实现替换,但是就是在别的设备上不行
sky170
2015-11-22 02:51:58 +08:00
@feather12315 额,我新手= =
Andy1999
2015-11-22 09:42:32 +08:00
@sky170 直接用 wen.lu 的源码
sky170
2015-11-22 13:47:27 +08:00
@Andy1999 就是 wenlu 的
lightforce
2015-11-22 18:00:48 +08:00
@feather12315 骚年, mainline 就是稳定版了
https://www.nginx.com/blog/nginx-1-6-1-7-released/
We recommend that in general you deploy the NGINX mainline branch at all times.
SCaffrey
2015-11-22 18:46:50 +08:00
sky170
2015-11-22 19:23:07 +08:00
@SCaffrey 已经搭建了一个,只是想添加一个站长统计,但是添加了没显示
KaneLin1217
2016-01-11 11:15:42 +08:00
@feather12315 在最新的 nginx 1.9.x mainline 中, sub_filter 已经可以多次使用了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/237973

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX