侧边栏壁纸
博主头像
峰峰火火博主等级

一条咸鱼罢了

  • 累计撰写 123 篇文章
  • 累计创建 90 个标签
  • 累计收到 59 条评论

目 录CONTENT

文章目录

记录一下资源文件无法加载,不能上传文件问题

峰峰火火
2021-01-24 / 0 评论 / 0 点赞 / 271 阅读 / 3,322 字 / 正在检测是否收录...
温馨提示:
若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

错误日志

控制台报 net::ERR_CONTENT_LENGTH_MISMATCH 200错误
Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATC
2021-01-24 09:42:03.545  WARN 26210 --- [qtp85748029-13] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: []
2021-01-24 09:42:03.546 ERROR 26210 --- [qtp85748029-13] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [Token 已过期或不存在], status: [401 UNAUTHORIZED], data: [5af4dbe0bc884fd9acec3bf603a740a3]
2021-01-24 09:42:03.555  WARN 26210 --- [qtp85748029-300] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: []
2021-01-24 09:42:03.555 ERROR 26210 --- [qtp85748029-300] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [Token 已过期或不存在], status: [401 UNAUTHORIZED], data: [5af4dbe0bc884fd9acec3bf603a740a3]
2021-01-24 09:42:03.560  WARN 26210 --- [qtp85748029-300] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: []
2021-01-24 09:42:03.560 ERROR 26210 --- [qtp85748029-300] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [Token 已过期或不存在], status: [401 UNAUTHORIZED], data: [5af4dbe0bc884fd9acec3bf603a740a3]
2021-01-24 09:42:03.602  WARN 26210 --- [qtp85748029-300] .s.h.DefaultAuthenticationFailureHandler : Handle unsuccessful authentication, ip: []
2021-01-24 09:42:03.603 ERROR 26210 --- [qtp85748029-300] .s.h.DefaultAuthenticationFailureHandler : Authentication failure: [Token 已过期或不存在], status: [401 UNAUTHORIZED], data: [5af4dbe0bc884fd9acec3bf603a740a3]
2021-01-24 09:42:35.807  WARN 26210 --- [Timer-0] run.halo.app.cache.AbstractCacheStore    : Cache key: [cache_lock_public run.halo.app.security.token.AuthToken run.halo.app.controller.admin.api.AdminController.refresh(java.lang.String)] has been expired
2021-01-24 09:45:43.607  INFO 26210 --- [qtp85748029-2243] r.h.app.service.impl.AdminServiceImpl    : You have been logged out, looking forward to your next visit!
2021-01-24 09:46:35.807  WARN 26210 --- [Timer-0] run.halo.app.cache.AbstractCacheStore    : Cache key: [cache_lock_public void run.halo.app.controller.admin.api.AdminController.logout()] has been expired
2021-01-24 09:46:35.808  WARN 26210 --- [Timer-0] run.halo.app.cache.AbstractCacheStore    : Cache key: [cache_lock_login_auth] has been expired
2021-01-24 09:46:35.808  WARN 26210 --- [Timer-0] run.halo.app.cache.AbstractCacheStore    : Cache key: [cache_lock_login_precheck] has been expired

由于项目是nginx反向代理的,而nginx是由docker部署的
所以先查看docker

命令df -h查看磁盘内存
所有的overlay全部100%.
说明了nginx缓存达到了顶峰,页面无法获取到资源


直接说解决方法吧

  • 清缓存
  • 设置nginx禁用缓存
#设置禁止浏览器缓存,每次都从服务器请求
add_header Cache-Control no-cache;
add_header Cache-Control private;
#设置缓存上面定义的后缀文件缓存到浏览器的生存时间
expires -1s;
  • 设置nginx最大缓存大小
proxy_cache_path /home/http/cache/ levels=1:2 keys_zone=my_cache:10m max_size=10g inactive=60m;
location ^~ /static2/ {
                proxy_cache my_cache;
                proxy_cache_valid  200 206 304 301 302 10d;
                proxy_cache_key $uri;
                proxy_set_header Host $host:$server_port;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass http://uuu;
        }
  • 重启服务器
  • 重新更换更大磁盘的服务器【笑脸】
0

评论区