Home  >  Article  >  Web Front-end  >  What should I do if nginx’s css doesn’t work?

What should I do if nginx’s css doesn’t work?

藏色散人
藏色散人Original
2021-02-08 10:23:032809browse

nginx css does not work because the file is accidentally deleted. The solution is to open the corresponding file and add the code "include /etc/nginx/mime.types;", and then restart the Nginx guardian. .

What should I do if nginx’s css doesn’t work?

The operating environment of this article: windows7 system, css3 version, DELL G3 computer.

Why does nginx’s css not work?

Recently deployed a project html, the js loaded normally, and the css did not report 404. The css could be obtained normally, but the browser could not parse it. After some research, I found that it turned out that /etc was changed when configuring Nginx. The line include /etc/nginx/mime.types; in /nginx/nginx.conf was accidentally deleted, causing Nginx to be unable to correctly identify the CSS file, and therefore sent the wrong MIME type to the browser. Add that line, and then restart the Nginx daemon.

What should I do if nginx’s css doesn’t work?

The wrong css and js types are as follows

What should I do if nginx’s css doesn’t work?

The correct css and js types should be as follows

What should I do if nginx’s css doesn’t work?

Recommended: "css video tutorial"

The above is the detailed content of What should I do if nginx’s css doesn’t work?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn