css and images not recognized by nginx: Resource interpreted as Stylesheet but transferred with MIME type text/html css and images not recognized by nginx: Resource interpreted as Stylesheet but transferred with MIME type text/html nginx nginx

css and images not recognized by nginx: Resource interpreted as Stylesheet but transferred with MIME type text/html


I think that it can solve your problem.

location ~ \.css {    add_header  Content-Type    text/css;}location ~ \.js {    add_header  Content-Type    application/x-javascript;}


I was having the same problem with CSS and Javascript files, that were being served as text/html. After trying everything I could think of during hours without any effect, it was automatically solved by restarting Chrome.


Add the code block below into the appropriate location block:

types {    text/css css;}