Symfony2:样式表已加载但未应用于NGINX,导致错误页面损坏 [英] Symfony2: Stylesheets loaded but not applied on NGINX leading to broken error pages

查看:33
本文介绍了Symfony2:样式表已加载但未应用于NGINX,导致错误页面损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了新鲜干净的Symfony应用.我正在使用NGINX作为我的网络服务器.

I've just installed a fresh and clean Symfony app. I'm using NGINX as my webserver.

样式表在devtools的网络"标签中没有显示http 404错误代码,我可以在预览"标签中正确看到其内容.

The stylesheets don't show a http 404 error code in devtools network-tab and i can see their content in the preview-tab correctly.

示例图片:

有人遇到这样的问题吗?我猜这可能是权限问题...

Did someone face any issue like this? I'm guessing it might be a permission issue...

编辑#1:附上chrome devtools图片,显示css已正确加载.

EDIT #1: Attached a picture of the chrome devtools showing the css are loaded correctly.

推荐答案

您需要确保您的 nginx.conf 实际上包含正确的mime类型.

You need to make sure your nginx.conf actually includes the correct mime-types.

http {
  include    conf/mime.types;
  # ...

...或...

types { 
  # ...
  text/css css; 

这篇关于Symfony2:样式表已加载但未应用于NGINX,导致错误页面损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆