我遇到了一个CSS问题。 这是一个基于Debian Squeeze(nginx / 0.7.67,php5 / cgi)的设置,我安装了最新的Roundcube 0.5 beta。
PHP正确处理,login工作正常,但CSS文件没有加载和Firefox抛出以下错误:
错误:样式表https://webmail.example.net:10443/roundcube/skins/default/common.css?s=1290600165
未被加载,因为它的MIMEtypes“text / html”不是“text / css”。 源文件: https ://webmail.example.net: 10443/ roundcube/ ?_task=login线路:0
- 镜像Ubuntu / Debian发行CD映像?
- Debian防火墙:Shorewall – VPN2VPN策略不起作用
- 从主机(mod_authz_host)拒绝是无效的
- debian lenny:修改静态IP的问题
- 如何从救援光盘安装Debian(通过SSH)
错误:样式表https://webmail.example.net:10443/roundcube/skins/default/mail.css?s=1290156319
未被加载,因为它的MIMEtypes“text / html”不是“text / css”。 源文件: https ://webmail.example.net: 10443/ roundcube/ ?_task=login线路:0
据我所知,nginx没有看到.css扩展名(因为?s =参数),因此将默认值设置为text / html。
我应该在nginx中解决这个问题(以及如何?)还是与roundcube相关?
编辑 :这似乎是nginx相关。 内容types不是为text / html之外的任何其他types设置的。 我不得不手动包含以下声明来强制CSS和JS内容types。 这是丑陋的,我从来没有遇到过这个问题…任何想法?
location ~ \.css { add_header Content-Type text/css; } location ~ \.js { add_header Content-Type application/x-javascript; }
同样对我来说,MIMEtypes是正确的,但是我用这个之后
location ~ \.css { add_header Content-Type text/css; } location ~ \.js { add_header Content-Type application/x-javascript; }
我得到一个404没有发现错误,删除该代码,CSS显示正常,但火狐不会加载它由于错误的MIMEtypes
我在Nginx 0.9.3上
发现问题! 看起来像我们正在通过PHP处理器运行一切添加这个:
if ($uri ~ "\.php"){ fastcgi_pass php-fpm; }
在location ~ ^\.php$ { section为我工作! 谢谢!