我从在线示例拼凑了下面的 uWSGI 配置文件。 (◠﹏◠)
鉴于此配置 - 位于/etc/uwsgi.d/myapp.ini
,用于启动uwsgi
守护程序,反过来myapp
通过systemd/systemctl
- 告诉它使用myapp
的特定虚拟环境PYTHON?
是home =
吗?
换句话说,当它调用django.wsgi
应用程序时,如何判断它(或者它如何知道)?/home/myapp_unixHome/.virtualenvs/myapp/bin/python
?
[uwsgi]
# =======================================================
# Directories ...
# =======================================================
home = /home/myapp_unixHome/.virtualenvs/myapp/ <--- Python virtualenv dir.
chdir = /home/myapp_unixHome/myapp/ <--- Django App here.
wsgi-file = /home/myapp_unixHome/myapp/django.wsgi <--- Including this django.wsgi file.
static-map = /m=/home/myapp_unixHome/myapp/static/ <--- Static files.
# =======================================================
# =======================================================
# TO BE NAMED ...
# =======================================================
master = true
processes = 5
# =======================================================
# =======================================================
# myapp communicates w/ nginx via a UNIX domain socket.
# =======================================================
socket = /run/uwsgi/myapp.sock
chmod-socket = 664
uid = nginx
gid = nginx
vacuum = true
# =======================================================
# =======================================================
# uWSGI Log file.
# =======================================================
logto = /var/log/uwsgi.log
# =======================================================
谢谢。
答案 0 :(得分:2)
是的,请查看此链接http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html
$config ['newline'] = "\r\n";
我希望它有所帮助