我试图在Nginx上设置uwsgi和Django,但显示页面未找到错误,错误日志为空。 我无法识别错误,因为错误日志是空的。在
错误日志/var/log/nginx/error.log
:
-rw-r--r-- 1 www-data root 0 Feb 26 12:31 error.log
在uswgi上正确运行此方法是因为:
uwsgi --http :8080 --home /home/flybegins/python/django/venv/ --chdir /home/flybegins/python/django/sample -w sample.wsgi
virtual host
server {
listen 80;
server_name test.aaaaaaa.com;
error_log /var/log/nginx/error.log
location /static/ {
root /home/flybegins/python/django/sample/
}
location / {
include uwsgi_params;
uwsgi_pass unix:/home/flybegins/python/django/sample/sample.sock;
} }
虚拟主机权限:
^{pr2}$提前谢谢!在
您正在使用端口8080运行项目,代码如下:
您正尝试使用此配置将NGINX绑定到不存在的套接字文件:
^{pr2}$这就是为什么它不起作用。在
您需要为uwsgi安装python插件
或者对于python 3
^{pr2}$我犯了两个错误一个是nginx虚拟主机配置,另一个是socket权限错误
uWSGI配置
要创建套接字存在的空间,只需选择一个持久目录(例如not/run或/tmp)并将www data(nginx的用户运行方式)设为其所有者,如下所示:
^{pr2}$我的nginx虚拟主机配置
相关问题 更多 >
编程相关推荐