Nginx does not load css files

I made a new Project in Django. On my local Computer it is working just fine so I tried to make it public here on DigitalOcean. I found a Tutorial which I followed. Now everything works just fine, but one little thing. Somehow the static CSS-files are not loading, which is really strange because the static images and javascript files are loading. In addition the admin page CSS files are all loaded correctly. I looked up the files on the server, which i uploaded via SFTP and all the static CSS files are on the correct place. I think it could be an Nginx Problem, but I am not sure, beacuse i am new to Nginx. I asked this Question on 2 Websites now and nobody seems to be able to help me. I hope someone can help me here.

(Projectname: bhitweb2) static files

STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'

    os.path.join(BASE_DIR, 'accounts/static/'),
    os.path.join(BASE_DIR, 'daten/static/'),

My Nginx:

server {
    listen 80;
    server_name <myserverip>;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
       root /home/djangodeploy/bhitweb2;

    location /media/  {
       root /home/djangodeploy/bhitweb2;

    location /css {
       root /home/djangodeploy/bhitweb2/static;

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/djangodeploy/bhitweb2/bhitweb2.sock;

error Message of every CSS file

<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.10.3 (Ubuntu)</center>

link to any stylesheet in HTML:

{% load static %}
<link rel="stylesheet" type="text/css" media="screen" href="{% static 'css/main.css' %}/" />

I have same problem and my settings is true that you said where up, but it is not load static files, can someone help me

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This happened to me and I simply had to clear my browser’s cache for it to work since everything else was properly configured.

use python collectstatic to server the file. It will move the files into staticfiles and will load the staticfiles from that folder.

Change this block

location /css {
       root /home/djangodeploy/bhitweb2/static;

to this one

location /static {
       root /home/djangodeploy/bhitweb2/static;

Then restart Nginx and it should work.

Hope this helps