title: open() "/root/project/static/*.css" failed (13: Permission denied) nginx
body: <p>I have gotta my project setup with <code>uwsgi, django, nginx</code>  Everything seems to be working fine but somehow I keep on getting the error on getting <code>static files</code> I have been reading through online and tried all the possible ways but I keep on getting this <code>permission denied</code> error on my static folder.</p>
  
  <p>Can someone please let me know what I have done wrong with the permission and how I should change it?</p>
  
  <p>this is my <code>/var/log/nginx/error.log</code></p>
  
  <p><code>open() "/root/project/static/*.css" failed (13: Permission denied), client: 2xx.xx.xx.xxx, server: _, request: "GET /static/*.css HTTP/1.1", host: "1xx.xx.xx.xxx"</code></p>
  
  <p>This is my <code>nginx site-available config</code></p>
  
  <pre><code>server {
      listen 80 default_server;
      listen [::]:80 default_server;
  
      # root /var/www/html;
  
      # Add index.php to the list if you are using PHP
      # index index.html index.htm index.nginx-debian.html;
  
      server_name _;
  
      #location = /favicon.ico { access_log off; log_not_found off; }
  
      #location /media  {
      #       root /root/project/mediafiles;
      #}
  
  
          location ^~ /static/ {
          allow all;  # this is from one of the posts but no luck
          auth_basic off;  # this is from one of the posts but no luck
              root /root/project;
          }
  
  
          location / {
              include         uwsgi_params;
              uwsgi_pass      unix:/tmp/uwsgi/project.sock;
          }
  
  }
  </code></pre>
  
  <p>as my folder permission</p>
  
  <p>for project folder it's <code>drwxr-xr-x 23 www-data www-data</code></p>
  
  <p>for static folder it's <code>drwxr-x---  8 www-data www-data 4096 May 23 14:40 static</code></p>
  
  <p>I never made the permission to static <code>755</code>  too but no luck.
  Anyways, this is using root as user instead of having an extra user and root is also in group of <code>www-data</code></p>
  
  <p>Thanks in advance for all the help.</p>
  
  <p>EDIT:</p>
  
  <p>As suggested this is the output of <code>ps aux | grep nginx</code></p>
  
  <pre><code>root       810  0.0  0.0 124972  1440 ?        Ss   02:18   0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
  www-data   811  0.0  0.0 125688  4840 ?        S    02:18   0:00 nginx: worker process
  www-data   812  0.0  0.0 125348  3196 ?        S    02:18   0:00 nginx: worker process
  root      1159  0.0  0.0  14224  1004 pts/0    S+   04:25   0:00 grep --color=auto nginx
  </code></pre>