Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

We migrated our web servers to Nginx mainly for performance reason, flexibility and ease of configuration (In this regard, a great load of satisfaction!).

However, only one site showed a strange behavior: it loads in its <head> a CSS

<link type="text/css" rel="stylesheet" href="/css/appli-test-local/appli.css">

and Firefox refuses to load the CSS file, complaining that the mime type is not css

The stylesheet http://client...com/css/appli-test-local/appli.css was not loaded because its MIME type, "text/html", is not "text/css".

while removing the dashes - works

<link type="text/css" rel="stylesheet" href="/css/applitestlocal/appli.css">


Nginx config

Regarding the Nginx config, its has been checked several times, against the numerous examples on the Net, the mime.types file contains

text/html                             html htm shtml;
text/css                              css;

and the nginx.conf for the main part

http {
  include    /etc/nginx/mime.types;
  include    /etc/nginx/fastcgi.conf;

  default_type application/octet-stream;

Is it likely to be a bug in Nginx having a hard time with dashes? Nginx being a well written piece of software, I'd be surprised, but it could be. Do I miss something obvious?

The problem happens only in Firefox, because FF does care about the mime types (which is a good thing!).

share|improve this question
    
please post your nginx version, and dont forget to restart after change nginx configuration. and clear browser cache. –  karo Nov 1 '10 at 14:10
    
Version 0.7.67. –  ring0 Nov 1 '10 at 14:35

2 Answers 2

up vote 0 down vote accepted

I compiled the latest nginx at the time, and the problem was still there. It seems it is a nginx bug in the path / regexp parsing that doesn't handle well dashes.

No relevant answer, so I'll accept this one.

share|improve this answer

If you installed Nginx through your default distro repo then you're most likely using a very outdated version of Nginx which might very well contain such a bug.

For testing you should try either finding an updated repo or compiling the latest version from source. If that does not help then paste server OS and whole config file.

share|improve this answer
    
That was not the problem. I compiled the latest nginx, and the problem was still there. –  ring0 Aug 24 '12 at 2:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.