title: Prevent nginx from serving css files as text/plain
body: <p>I'm configuring nginx to load only static files and I don't know why .css files are interpreted as text/plain - finally browser couldn't load it.</p>
  
  <pre><code>Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://localhost:13000/styles.css".
  </code></pre>
  
  <p>when I check response header in web browser of css file:</p>
  
  <pre><code>Content-Type: text/plain
  </code></pre>
  
  <p>I know that on stack we have a lot of issues with it, I've already read them but still doesn't work.</p>
  
  <p>in html file I've just import css:</p>
  
  <pre><code>&lt;link href="styles.css" rel="stylesheet" type="text/css"/&gt;
  </code></pre>
  
  <p>my /etc/nginx/nginx.conf is:</p>
  
  <pre><code>worker_processes        1;
  events {
      worker_connections  512;
  }
  
  http {
      server {
          listen       80;
          server_name  0.0.0.0:80;
          include /etc/nginx/mime.types;
          root   /project/app;
  
          location ~* ^.+\.(js|css)$ {
              expires 10d;
          }
      }
  }
  </code></pre>
  
  <p>I tried without any location part or tried with:</p>
  
  <pre><code>location ~ \.css {
   add_header Content-Type text/css;
  }
  </code></pre>
  
  <p>In some responses in other threads I saw that this part is required:</p>
  
  <pre><code>default_type  application/octet-stream;
  include       /etc/nginx/mime.types;
  </code></pre>
  
  <p>I added it in <code>http</code> part and after that in <code>server</code> and then in <code>location</code>, still didn't help me.</p>
  
  <p>Is there anything else what can I do to fix it?</p>