奇特简易出国--出国了但没完全出国
404站
项目地址Nginx Module for Google Mirror
依赖库
Installation
Download sources first
1 | |
Brand new installation
1 | |
宝塔安装
创建模块文件夹
下载库
1
2
3
4
5
6
7git clone https://github.com/cuber/ngx_http_google_filter_module
#
# clone ngx_http_substitutions_filter_module
# @see https://github.com/yaoweibin/ngx_http_substitutions_filter_module
#
git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module安装
软件商店–Nginx–配置
踩坑点,Nginx高版本应使用–add-dynamic-module引入第三方模块
1
2--add-dynamic-module=</path/to/>ngx_http_google_filter_module \
--add-module=</path/to/>ngx_http_substitutions_filter_module使用
- 编辑Nginx配置文件,最上方加入
踩坑点,Nginx高版本应手动引入第三方模块
1
load_module modules/ngx_http_google_filter_module.so;- 编辑网站配置文件,加入
1
2
3
4resolver 8.8.8.8;
location / {
google on;
}- 注释,否则部分css,logo无法加载。原因:源站不存在静态资源,故关闭源站目录,全局反代。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31server
{
# index index.php index.html index.htm default.php default.htm default.html;
# root domain;
#ERROR-PAGE-START 错误页配置,可以注释、删除或修改
#error_page 404 /404.html;
#error_page 502 /502.html;
#ERROR-PAGE-END
#PHP-INFO-START PHP引用配置,可以注释或修改
# include enable-php-00.conf;
#PHP-INFO-END
#REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
# include /www/server/panel/vhost/rewrite/google.zyhwjl.cf.conf;
#REWRITE-END
# location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
# {
# expires 30d;
# error_log /dev/null;
# access_log /dev/null;
# }
# location ~ .*\.(js|css)?$
# {
# expires 12h;
# error_log /dev/null;
# access_log /dev/null;
# }- 编辑Nginx配置文件,最上方加入
Github
编辑网站配置文件
1 | |
注释内容参照404网站