debian11 测试通过
优化脚本
curl -sS -O https://raw.githubusercontent.com/woniu336/open_shell/main/menu.sh && chmod +x menu.sh && ./menu.sh
首先安装宝塔面板
以下脚本安装的是宝塔原版7.7.0版本,可以解除手机号登录
- 安装bt
curl -sS -O https://raw.githubusercontent.com/woniu336/open_shell/main/tp.sh && chmod +x tp.sh && ./tp.sh
或者使用以下脚本
curl -sSO https://raw.githubusercontent.com/8838/btpanel-v7.7.0/main/install/install_panel.sh && bash install_panel.sh
1,屏蔽手机号
sed -i "s|bind_user == 'True'|bind_user == 'XXXX'|" /www/server/panel/BTPanel/static/js/index.js
2,删除强制绑定手机js文件
rm -f /www/server/panel/data/bind.pl
使用编译的方式安装nginx1.27版本
获取真实访客ip:
pip3 install requests
wget https://raw.githubusercontent.com/woniu336/open_shell/main/update_cf_ips.py
chmod +x update_cf_ips.py
python3 update_cf_ips.py
定时任务
(crontab -l ; echo "0 0 */15 * * python3 update_cf_ips.py >/dev/null 2>&1") | crontab -
证书申请
适配宝塔面板,自动续期
curl -sS -O https://raw.githubusercontent.com/woniu336/open_shell/main/ssl-cert.sh && chmod +x ssl-cert.sh && ./ssl-cert.sh
修改配置
注意:源站必须是443
a.com替换成用户访问的域名,b.com替换成源站域名
用户访问的域名解析到反代ip,不是源站ip
nginx使用以下配置,覆盖重启即可
https://github.com/woniu336/open_shell/blob/main/bt-cf/nginx.conf
443站点使用以下配置
https://github.com/woniu336/open_shell/blob/main/bt-cf/https.conf
80站点使用以下配置(开启cf cdn)
https://github.com/woniu336/open_shell/blob/main/bt-cf/http.conf
禁止使用ip访问站点
https://blog.taoshuge.eu.org/p/294/
haproxy转发
设置转发脚本
curl -sS -O https://raw.githubusercontent.com/woniu336/open_shell/main/bt-cf/haproxy/setup_haproxy.sh && chmod +x setup_haproxy.sh && ./setup_haproxy.sh
如果使用haproxy转发反代ip,使用以下配置
注意:域名解析到haproxy ip 而不是反代ip
haproxy转发的方式需要使用不同的配置
a.com替换成用户访问的域名,b.com替换成源站域名
nginx使用以下配置,覆盖重启即可
https://github.com/woniu336/open_shell/blob/main/bt-cf/haproxy/nginx-s.conf
注意:set_real_ip_from 3.3.3.3;
替换成haproxy ip(即转发ip)
443站点使用以下配置
https://github.com/woniu336/open_shell/blob/main/bt-cf/haproxy/https-s.conf
80站点使用以下配置(开启cf cdn)
注意:set_real_ip_from 3.3.3.3;
替换成haproxy ip(即转发ip)
https://github.com/woniu336/open_shell/blob/main/bt-cf/haproxy/http-s.conf
最后重启nginx
…