1

I'm mounting a server with nginx, and I have some issue with my css. On IE it's well displayed, but the firefox's console says me that my css files were not loaded because their mime type is text/plain and not text/css.

In my server, I've got this into the "mime.types" file :

text/css css;

I have included mime.types in my nginx.conf :

include /etc/nginx/mime.types;

And in my index.html, my stylesheet is imported this way :

<link href = "./css/stable.css" rel = "stylesheet" type="text/css"/>
<style type="text/css">
@import "./css/style.css";
</style>

My js files are recognized as .js by firefox, the issue is only with .css files, I don't understand why (and why this is working on IE)

What am I doing wrong ?

Thank you

  • Sorry I had forgotten a "/", I just edited it. Yep, I root to the folder with my index.html in the nginx.conf, and my "css" folder is here. – Jean Dupont Jul 06 '18 at 09:04
  • Use `curl -v` and check the value of the `content-type` HTTP header. – Ortomala Lokni Jul 08 '18 at 13:41
  • I have text/html – Jean Dupont Jul 08 '18 at 21:02
  • So the problem comes from your Nginx configuration and not from Firefox. Do you have some warnings in the Nginx logs? – Ortomala Lokni Jul 09 '18 at 07:29
  • Did you check this: [Nginx fails to load css files](https://stackoverflow.com/questions/10075304/nginx-fails-to-load-css-files?rq=1) ? – Ortomala Lokni Jul 09 '18 at 15:39
  • Yes I've already checked this, I try to reinstall everything and I'll tell you how it goes. I didn't have warnings due to this in the logs, thanks for your answers – Jean Dupont Jul 10 '18 at 07:42
  • @JeanDupont did you manage to solve this ? I am having this issue as well. Would like to know if you have found a solution. Thanks – Jeremy Sep 20 '18 at 13:04
  • In fact I was trying to install an application manually, but I have found a script that installs it automatically so I've used it like a lazy person. I don't have answers for you, sorry – Jean Dupont Sep 21 '18 at 17:05

0 Answers0