Hi @KenWhitesell,
You don’t want to retrieve static files from your home directory - you want to move the static files into a directory that nginx is going to have access to.
Well I agree with you but according to DigitalOcean, one should set Nginx like this :
server {
listen 80;
server_name server_domain_or_IP;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/sammy/myprojectdir;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
}
But I think that you are right because I now get a 403 forbidden nginx page when I try to access my css files :
http://192.168.1.69/static/css/layout.css

So it’s obvious that it is a permission issue, nginx actually doesn’t seem to have “authorization” to serve /home/theo/mywebsite/static/ (yet it can serve the html files, I don’t understand why ?)
Here is what I get after doing :
> cat /var/log/nginx/error.log
2020/12/15 11:27:20 [error] 436#436: *1 open() "/home/theo/Blog/static/css/layout.css" failed (13: Permission denied), client: 192.168.1.52, server: 192.168.1.69, request: "GET /static/css/layout.css HTTP/1.1", host: "192.168.1.69", referrer: "http://192.168.1.69/"
2020/12/15 11:27:20 [error] 436#436: *3 open() "/home/theo/Blog/static/css/fonts.css" failed (13: Permission denied), client: 192.168.1.52, server: 192.168.1.69, request: "GET /static/css/fonts.css HTTP/1.1", host: "192.168.1.69", referrer: "http://192.168.1.69/"
2020/12/15 11:27:20 [error] 436#436: *4 open() "/home/theo/Blog/static/css/app_base/navbar.css" failed (13: Permission denied), client: 192.168.1.52, server: 192.168.1.69, request: "GET /static/css/app_base/navbar.css HTTP/1.1", host: "192.168.1.69", referrer: "http://192.168.1.69/"
2020/12/15 11:27:20 [error] 436#436: *5 open() "/home/theo/Blog/static/css/app_base/articles.css" failed (13: Permission denied), client: 192.168.1.52, server: 192.168.1.69, request: "GET /static/css/app_base/articles.css HTTP/1.1", host: "192.168.1.69", referrer: "http://192.168.1.69/"
2020/12/15 11:27:20 [error] 436#436: *6 open() "/home/theo/Blog/static/css/app_base/footer.css" failed (13: Permission denied), client: 192.168.1.52, server: 192.168.1.69, request: "GET /static/css/app_base/footer.css HTTP/1.1", host: "192.168.1.69", referrer: "http://192.168.1.69/"
2020/12/15 11:27:27 [error] 436#436: *6 open() "/home/theo/Blog/static/css/fonts.css" failed (13: Permission denied), client: 192.168.1.52, server: 192.168.1.69, request: "GET /static/css/fonts.css HTTP/1.1", host: "192.168.1.69"
2020/12/15 11:27:31 [error] 436#436: *6 open() "/home/theo/Blog/static/css/app_base/articles.css" failed (13: Permission denied), client: 192.168.1.52, server: 192.168.1.69, request: "GET /static/css/app_base/articles.css HTTP/1.1", host: "192.168.1.69"
2020/12/15 11:27:42 [error] 436#436: *6 open() "/home/theo/Blog/static/css/layout.css" failed (13: Permission denied), client: 192.168.1.52, server: 192.168.1.69, request: "GET /static/css/layout.css HTTP/1.1", host: "192.168.1.69"
2020/12/15 11:51:02 [error] 436#436: *8 open() "/home/theo/Blog/static/css/app_base/navbar.css" failed (13: Permission denied), client: 192.168.1.52, server: 192.168.1.69, request: "GET /static/css/app_base/navbar.css HTTP/1.1", host: "192.168.1.69"
2020/12/15 11:51:06 [error] 436#436: *8 open() "/home/theo/Blog/static/css/layout.css" failed (13: Permission denied), client: 192.168.1.52, server: 192.168.1.69, request: "GET /static/css/layout.css HTTP/1.1", host: "192.168.1.69"
2020/12/15 11:51:38 [error] 436#436: *8 open() "/home/theo/Blog/static/css/layout.css" failed (13: Permission denied), client: 192.168.1.52, server: 192.168.1.69, request: "GET /static/css/layout.css HTTP/1.1", host: "192.168.1.69"