新增一個基於網域名稱的虛擬機器主機後,訪問該虛擬機器主機目錄下的css檔案,Response Headers 中的Content-Type值為 text/html http://k1ic.com/static/frame.css
nginx.conf nginx.conf
k1ic.com.conf k1ic.com.conf
3.解決
注意到配置php-fpm處為萬用字元“/”,使得所有請求均會被php-fpm處理,導致css檔案的回應標頭出錯,修改如下: k1ic.com.conf
重啟nginx服務
http://k1ic.com/static/frame.css http://k1ic.com/static/frame.css
4.分析
img
ps -ef | grep nginx | grep -v grep
strace -p 14527 strace -p 14527
nginx模組分類 nginx模組分類
5.參考資料
1.Nginx fails to load css files
2.nginx always handle css as text/plain
3.http://forum.nginx.org/read.php?2,155222,155230
4.http://yansu.org/2014/02/15/apache-and-nginx.html
5.http://wiki.nginx.org/ServerBlockExample
6.http://www.cnblogs.com/xiaogangqq123/archive/2011/03/02/1969006.html
7.http://my.oschina.net/u/1156660/blog/364955
8.http://bg.biedalian.com/2014/09/08/useful-nginx-fragment.html
9.http://www.oschina.net/question/17_655
10.http://huanghuizz.iteye.com/blog/1909180
11.http://tengine.taobao.org/book/chapter_02.html
12.http://www.pagefault.info/?p=123