I use nginx, I have include mime.types and I keep having error when I try access my css files. I tried insert "include /etc/nginx/mime.types;" in "location /" but didn't works.
This is my nginx.conf:
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
server_names_hash_bucket_size 64;
upstream test_server {
server unix:/var/www/test/run/gunicorn.sock fail_timeout=10s;
}
server {
listen 80;
server_name ec2-#-#-#-#.sa-east-1.compute.amazonaws.com;
client_max_body_size 4G;
access_log /var/www/test/logs/nginx-access.log;
error_log /var/www/test/logs/nginx-error.log warn;
location /static/ {
autoindex on;
alias /var/www/test/my-example/static/;
include /etc/nginx/mime.types;
}
location /media/ {
autoindex on;
alias /var/www/test/my-example/media/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://test_server;
break;
}
}
#For favicon
location /favicon.ico {
alias /var/www/test/test/static/img/favicon.ico;
}
#For robots.txt
location /robots.txt {
alias /var/www/test/test/static/robots.txt ;
}
# Error pages
error_page 500 502 503 504 /500.html;
location = /500.html {
root /var/www/test/my-example/static/;
}
}
}
And head of my html:
<link rel="stylesheet" type="text/css" href="../static/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="../static/css/combo.css">
<link rel="stylesheet" type="text/css" href="../static/css/font-awesome.min.css">
<link rel='stylesheet' type="text/css" href="../static/css/raleway.css">
But I keep having this error:
was not loaded because its MIME type, "text/plain", is not "text/css"