Filename : /etc/systemd/system/gunicorn.service
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
# Update all paths below
# Setting provided are for reference only !
User=webapp
Group=www
WorkingDirectory=/var/webapps/sbprod/django_project_dir
ExecStart=/var/webapps/virtual_sample_env/bin/gunicorn --workers 2 --bind unix:/var/webapps/run/SOMENAME.sock Django_project_name.wsgi:application
[Install]
WantedBy=multi-user.target
Domain : xyz.com
server {
listen 80;
server_name xyz.com;
access_log /var/webapps/xyz.com/logs/access.log;
error_log /var/webapps/xyz.com/logs/error.log;
root /var/webapps/xyz.com/public_html/;
index index.php index.html index.htm;
location = /favicon.ico { access_log off; log_not_found off; }
# serve static content
location /static/ {
# Update correct static folder path
root /var/webapps/xyz/main/;
}
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# use the sock created in above gunicorn file
proxy_pass http://unix:/var/webapps/run/SOMENAME.sock;
}
}
whats is configuration for two project django in gunicorn ?