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

I encountered this situation for the first time. I originally thought that the CSS style file was not loaded. Later, I checked the network and found that the CSS was loaded but the page did not load the CSS style. Baidu found that one way was to delete the declaration header

But this method treats the symptoms but not the root cause.Later, it was found that the reason was that the css file was passed to the browser as a test/plain, which caused the browser to not recognize it.After loading, the solution is to add these two lines to the http of nginx.

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

Guess you like

Origin blog.csdn.net/weixin_38987500/article/details/111992611