Resource interpreted as Stylesheet but transferred with MIME type text/plain: “<URL>“.

此问题是由于nginx配置导致css文件不能正常解析

nginx配置一切搞定之后,访问网站,没有报错,但是样式貌似没有加载成功,第一反应是css丢失,然后查看代码,都是OK的,但是有很多条黄色的提示:Resource interpreted as Stylesheet but transferred with MIME type text/plain,查了N久,发现是nginx配置的问题:

include /etc/nginx/mime.types;(是nginx安装的位置,我是安装在home下,故与此不同)

不加这一行的话,nginx不能识别文件类型,所以加载成功但是没有解析。

然后重启nginx,再刷新网页,一切正常了!

猜你喜欢

转载自blog.csdn.net/weixin_47385625/article/details/114980259