Symfony2: Stylesheets loaded but not applied on NG

2019-07-19 06:38发布

问题:

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

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.

example picture:

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

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

回答1:

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

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

... or ...

types { 
  # ...
  text/css css;