繁体   English   中英

尝试连接到上游Ubuntu 14.04 Gunicorn时,nginx权限被拒绝

[英]nginx permission denied while attempting to connect to upstream Ubuntu 14.04 Gunicorn

好。 我在这里尽头了。 我已经完成了这项工作,然后不确定是否只是巧合,但是我在服务器上设置了VNC并停止了工作(本教程之后: https : //www.digitalocean.com/community/tutorials/how-to -install-and-configure-vnc-on-ubuntu-14-04

我通过Digital Ocean有一个Django项目。 我遵循了在这里找到的教程: https : //www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-14-04

sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

cat /var/log/nginx/error.log
015/05/04 22:03:33 [crit] 6399#0: *3 connect() to unix:/path/to/project.sock failed (13: Permission denied) while connecting to upstream, client: ipaddress, server: myproject.com, request: "GET / HTTP/1.1", upstream: "http://unix:/path/to/project.sock:/", host: "myproject.com"

ls -lh ~/myproject
srwxrwxrwx 1 myusername www-data    0 Apr  1 12:37 myproject.sock

我一直在搜寻,但是我找不到与我的问题似乎完全相符的东西,尽管我感觉这只是一个愚蠢的许可,但是有所改变。

如果上面还有什么不清楚的地方,请让我详细说明。

我认为您在nginx conf文件中的sock文件弄错了:

proxy_pass http://unix:/home/user/myproject/myproject.sock;

如错误日志中所示,nginx尝试打开/path/to/project.sock文件。 将其更改为/home/username/myproject/myproject.sock

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM