Connect()到.sock失败,没有这样的文件

时间:2017-07-13 11:04:22

标签: python django nginx uwsgi

我有一个Django应用程序在python manage.py runserver 0.0.0.0:8443的localhost上正常运行。

现在,我有一台服务器,我想运行该应用程序。为此,我跟着this guide

这里我设置了一个virtualenv,配置了uWSGI和nginx。据我所知,一切都设置正确,但当我尝试到达我的地址时,它返回502error.log

中发现以下错误
2017/07/13 11:24:11 [crit] 4825#0: *1 connect() to unix:/home/django/sample/sample.sock failed (2: No such file or directory) while connecting to upstream, client: 131.180.112.131, server: annotatie01.io.tudelft.nl, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:/data_nfs/data_collection_project.sock:", host: "annotatie01.io.tudelft.nl:8443", referrer: "http://annotatie01.io.tudelft.nl:8443/"

似乎永远不会创建.sock文件。我也无法在目录中找到它。该文件应该在哪里创建?

我已经看到了一些与此相关的问题,但对于那些看起来.socks确实存在,或者他们没有使用uWSGI

uWSGI:

档案:/etc/uwsgi/sites/data_collection_project.ini

[uwsgi]
project = data_collection_project
base = /data_nfs

chdir = %(base)/%(project)
home = %(base)/Env/%(project)
module = %(project).wsgi:application

master = true
processes = 2

socket = %(base)/%(project)/%(project).sock
chmod-socket = 664
vacuum = true

档案:/etc/init/uwsgi.conf

description "uWSGI"
start on runlevel [2345]
stop on runlevel [06]
respawn

env UWSGI=/usr/local/bin/uwsgi
env LOGTO=/var/log/uwsgi.log

exec $UWSGI --master --emperor /etc/uwsgi/sites --die-on-term --uid django --gid www-data --logto $LOGTO

0 个答案:

没有答案