简体   繁体   中英

Setup multiple django gunicorn instances with nginx

Got one django site running with gunicorn & nginx need to setup another site also with the same. Nginx settings is straight forward, how to rework below to add another site /home/ubuntu/webapps/uganda_buzz/

relevant settings are /etc/init/gunicorn.conf

description "Gunicorn application server handling all projects"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
setuid user
setgid www-data
chdir /home/ubuntu/webapps/kenyabuzz

exec /home/ubuntu/webapps/djangoenv/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/webapps/kenyabuzz/kb.sock kb.wsgi:application

and /etc/systemd/system/gunicorn.service

[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=ubuntu
Group=nginx
WorkingDirectory=/home/ubuntu/webapps/kenyabuzz
ExecStart=/home/ubuntu/webapps/djangoenv/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/webapps/kenyabuzz/kb.sock kb.wsgi:application

[Install]
WantedBy=multi-user.target

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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