在nginx下,用CI写个BLOG玩(学习PHPing),最后联调的时候发现css没起作用。查看chrome的出错信息后发现,这个css文件居然是以 text/html 的MIME类型发给浏览器的。
然后各种折腾配置文件无果,最后只得手动加了两行非常ungly的设定,才解决问题。
location ~ .css {
add_header Content-Type text/css;
}
location ~ .js {
add_header Content-Type application/x-javascript;
}
检查过了,nginx.conf里的include /etc/nginx/mime.types啥的都在,没问题。
小弟刚开始学习服务器编程,在此向各位学长请教,多谢!
然后各种折腾配置文件无果,最后只得手动加了两行非常ungly的设定,才解决问题。
location ~ .css {
add_header Content-Type text/css;
}
location ~ .js {
add_header Content-Type application/x-javascript;
}
检查过了,nginx.conf里的include /etc/nginx/mime.types啥的都在,没问题。
小弟刚开始学习服务器编程,在此向各位学长请教,多谢!