换服务器需要做的工作(记录一下)
1.Nginx开启OCSP 加快Let’s Encrypt免费证书 HTTPS网站访问速度
https://blog.csdn.net/wx23986/article/details/141722669
2.添加伪静态规则
location / {rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;rewrite ^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;rewrite ^([^\.]*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3 last;rewrite ^([^\.]*)archive.html$ $1plugin.php?id=nimba_archive:list last;rewrite ^([^\.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3 last;if (!-e $request_filename) {return 404;}
}
3.站点设置--其他设置--Nginx安全请求头 开启下面两个 其他的不要选
特别是不要选:让浏览器加载内容时只加载自己网站的内容
不然注册和登录 验证码无法显示
开启下面两个 其他的不要选
阻止浏览器上下文中执行恶意JavaScript代码
阻止浏览器的内容嗅探
4.Waf里面勾选 禁IDC访问----假蜘蛛---CC防御
5.Discuz! X3.5 根 目录权限设置
https://blog.csdn.net/wx23986/article/details/145721885
6.404替换
站点---配置文件
把error_page 404 /404.html; 替换成 error_page 404 /404.php;
7.宝塔加固建议
https://blog.csdn.net/wx23986/article/details/145750491