supervisor 和gunicorn部署django项目
安装使用到的基本软件nginx、supervisor、gunicorn
vi /etc/supervisor/conf.d/django_project.conf
[program:django_project] command=gunicorn xxx.wsgi:application -b 127.0.0.1:8080 -w 8 user=user #当前用户 directory=/home/user/django_project stdout_logfile=/tmp/var/logs/supervisor/%(program_name)s-stdout.log stderr_logfile=/tmp/var/logs/supervisor/%(program_name)s-stderr.log killasgroup=true stopasgroup=true autorstart=true autorestart=true # rq队列的配置 [program:rqworker] command=python manage.py rqworker default low user=user directory=/home/django_project/platform stdout_logfile=/tmp/var/logs/supervisor/%(program_name)s-stdout.log stderr_logfile=/tmp/var/logs/supervisor/%(program_name)s-stderr.log killasgroup=true stopasgroup=true autorstart=true autorestart=true``` 再在nginx配置中的location,添加
proxy_pass http://127.0.0.1:8080;
另外静态文件的代理可以添加下面的配置
location /static/ {
alias /django_project/statics/;
}
相关推荐
htofly 2020-06-03
username=user ; should be same as http_username if set. password=123 ; should be same as http_passwo
bysidewithsun 2020-05-14
lap00 2020-05-05
SDUTACM 2020-05-03
wangyibo00 2020-03-07
柠檬班 2020-02-03
lap00 2014-01-19
wangyibo00 2019-10-06
dashoumeixi 2019-09-11
xufwind 2012-06-27
tuxlcsdn 2019-07-01
lnkToKing 2019-06-30
七夕小子 2019-06-29
bigzhao 2019-06-28
mingrixing 2019-06-28
kewei 2019-06-27
Owengoodman 2019-06-26
wangyibo00 2019-06-26