Resource interpreted as Stylesheet but transferred with MIME type text/plain错误处理

本人第一次遇到这种情况,原先是以为css样式文件没加载,后来查看network发现css加载完毕 但是页面没加载css样式,百度后发现一种方法是删除声明头

但是这种方法治标不治本,后来找到原因是 css文件被当做是test/plain传到浏览器,导致浏览器无法识别,加载后直接过滤 解决方法 是在nginx 的http中加入这两行

        include       mime.types;
        default_type  application/octet-stream;

猜你喜欢

转载自blog.csdn.net/weixin_38987500/article/details/111992611