首页 > 其他 > 详细

nginx - Resource interpreted as Stylesheet but transferred with MIME type text/plain

时间:2017-06-03 09:24:58      阅读:5317      评论:0      收藏:0      [点我收藏+]

在部署前端项目的时候,网站跑起来了,可就是css样式没加载出来,查看css文件也已经load进来,被坑了3个小时终于发现问题所在:

nginx.conf中添加下面两行配置即可,可参考nginx默认配置文件

 

include mime.types;

default_type application/octet-stream;

 

如果不设置css文件就会被当作text/plain类型发送到浏览器。从而导致css样式无法显示

nginx - Resource interpreted as Stylesheet but transferred with MIME type text/plain

原文:http://www.cnblogs.com/teamus/p/6935940.html

(0)
(2)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!