码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2017-06-03 09:53:28      阅读:340      评论:0      收藏:0      [点我收藏+]

标签:res   类型   ext   styles   配置   oct   nsf   前端   配置文件   

在部署前端项目的时候,网站跑起来了,可就是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

标签:res   类型   ext   styles   配置   oct   nsf   前端   配置文件   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!