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.
Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://localhost:13000/styles.css".
when I check response header in web browser of css file:
Content-Type: text/plain
I know that on stack we have a lot of issues with it, I've already read them but still doesn't work.
in html file I've just import css:
<link href="styles.css" rel="stylesheet" type="text/css"/>
my /etc/nginx/nginx.conf is:
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;
}
}
}
I tried without any location part or tried with:
location ~ \.css {
add_header Content-Type text/css;
}
In some responses in other threads I saw that this part is required:
default_type application/octet-stream;
include /etc/nginx/mime.types;
I added it in http
part and after that in server
and then in location
, still didn't help me.
Is there anything else what can I do to fix it?