A
A
Alex Xmel2020-09-27 00:48:13
Nginx
Alex Xmel, 2020-09-27 00:48:13

How to properly configure gunicorn for two sites on the same ip?

There are 2 projects on django, you need to place them in one vps.
It seems that I figured out everything, but I can’t figure out what to do with gunicorn.
Deploy based on this article here: https://www.digitalocean.com/community/tutorials/h...

accordingly created gunicorn.socket file with the following content:
[Unit]
Description=gunicorn socket

[Socket]
ListenStream=/run/ gunicorn.sock

[Install]
WantedBy=sockets.target

this file, as I understand it, is one and common for all gunicorn,

and here is the settings file for the gunicorn service itself:
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
User=sammy
Group=www-data
WorkingDirectory=/home/sammy/myprojectdir
ExecStart=/home/sammy/myprojectdir/myprojectenv/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn. sock \
myproject.wsgi:application

[Install]
WantedBy=multi-user.target

how to specify two different projects here?
How to simply create 2 domainname.conf files with nginx does not work here. What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-09-27
@dimonchik2013

https://djbook.ru/examples/62/
only there are a couple of errors in the commands, well - you will understand
each project - your gunicorn settings, nothing complicated

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question