失败(13:权限被拒绝)带有 Django 的 nginx 服务器

失败(13:权限被拒绝)带有 Django 的 nginx 服务器

我在 nginx 服务器上收到权限被拒绝错误,对于由 django 压缩器创建的 CACHE 文件夹,错误是

"/home/xxxx/myproject/static/CACHE/js/output.dabd456b15d4.js" failed (13: Permission denied), client: 112.196.162.182, server: example.com, request: "GET /static/CACHE/js/output.dabd456b15d4.js HTTP/1.1", host: "abc.example.com", referrer: "https://abc.example.com/member/dashboard/"

权限如下

drwxrwxr-x 26 xxxx xxxx     4096 Oct  8 05:44 .
drwxrwxr-x 14 xxxx xxxx     4096 Oct 26 13:49 ..
drwxr-xr-x  4 xxxx www-data 4096 Oct 26 13:54 CACHE
drwxrwxr-x  7 xxxx xxxx     4096 May 11 04:02 admin
drwxrwxr-x  7 xxxx xxxx     4096 Feb  4  2021 assets
drwxrwxr-x  2 xxxx xxxx     4096 Sep 24  2020 autocomplete_light
drwxrwxr-x  5 xxxx xxxx     4096 Sep  9  2020 ckeditor
drwxrwxr-x  5 xxxx xxxx     4096 Oct 23  2020 client_admin
drwxrwxr-x  5 xxxx xxxx     4096 Sep 24  2020 client_admin_new
drwxrwxr-x  3 xxxx xxxx     4096 May 28 04:41 client_members
drwxrwxr-x  3 xxxx xxxx     4096 Sep  3  2020 clients
drwxrwxr-x  3 xxxx xxxx     4096 Nov 23  2020 css
drwxrwxr-x  2 xxxx xxxx     4096 Sep 23  2020 data_table

Gunicorn 的服务文件如下

[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
User=xxxx
Group=www-data
WorkingDirectory=/home/xxxx/myproject
ExecStart=/home/xxxx/myproject/env/bin/gunicorn \
          --access-logfile - \
          --workers 3 \
          --bind unix:/run/gunicorn.sock \
          mysite.wsgi:application

[Install]
WantedBy=multi-user.target

xxxx是用户,请问该如何解决,求指点,谢谢

相关内容