Nginx css file Content-type for text/html problem resolution __html

Source: Internet
Author: User
Tags configuration php fpm

After adding a domain based virtual host, access the CSS file in the virtual host directory, the Content-type value in Response Headers is text/html http://k1ic.com/static/frame.css

Nginx.conf nginx.conf

K1ic.com.conf k1ic.com.conf

3. Address

Note that the configuration php-fpm is a wildcard "/" so that all requests will be php-fpm processed, causing the CSS file to respond to the header error, modified as follows: k1ic.com.conf

Restart the Nginx service

Http://k1ic.com/static/frame.css Http://k1ic.com/static/frame.css

4. Analysis

Img

Ps-ef | grep Nginx | Grep-v grep

Strace-p 14527 strace-p 14527

Nginx Module Classification Nginx module classification

5. Reference materials

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.