我的Typecho问题集锦
前言
后台问题
插件关闭不了怎么办
数据库typecho_options表,找到plugin修改为
a:0:{}
取消全部插件,然后重新启动。
解决Typecho插件卸载后,后台菜单有残余堆叠的问题
打开数据库typecho_options表,找到panelTable编辑值:
a:2:{s:5:"child";a:2:{i:1;a:0:{}i:3;a:0:{}}s:4:"file";a:0:{}}
反向代理后后台带refer并且登录刷新进不去
修改反向代理的配置文件,原因是缓存了html和admin目录:
# PROXY-START/
location / {
# 缓存媒体文件
location ~* \.(jpg|png|gif|jpeg|ttf|webp|woff|woff2|ico)$ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_pass https://www.hansjack.com;
proxy_cache cache_one;
proxy_cache_valid 30d;
proxy_ignore_headers Cache-Control;
add_header X-Cache "$upstream_cache_status from $server_addr";
}
# 缓存 CSS、JS
location ~* \.(css|js)$ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_pass https://www.hansjack.com;
proxy_cache cache_one;
proxy_cache_valid 3d;
proxy_ignore_headers Cache-Control;
add_header X-Cache "$upstream_cache_status from $server_addr";
}
# 其他请求(默认转发,不缓存)
proxy_pass https://www.hansjack.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
# 可选持久化连接设置(根据需要开启)
# proxy_connect_timeout 30s;
# proxy_read_timeout 86400s;
# proxy_send_timeout 30s;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# add_header X-Cache $upstream_cache_status;
# expires 12h;
}
# PROXY-END/
# 后台路径禁止缓存
location /admin {
proxy_pass https://www.hansjack.com;
proxy_cache_valid any 0s;
}
如果出现后台404,可能伪静态没有设置好
试试下面的:
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}