Answer the question
In order to leave comments, you need to log in
How to automatically start Django on Nginx + Uwsgi?
Hello!
How to automatically launch a Django site after a server restart?
With this command, the site is fully working in conjunction with Nginx + Uwsgi, uwsgi --ini project_app.ini
after rebooting the OS, the site does not start.
How to do it right. I read a lot of information, but this is how my site got up) you can see an example
Answer the question
In order to leave comments, you need to log in
On Debian 8, I did this:
Nginx gets up by default after a reboot. Here are its configs: /etc/nginx/sites-available/mysite.conf and its symlink /etc/nginx/sites-enabled/mysite.conf:
upstream django {
server unix:///tmp/mysite.sock;
}
server {
listen 80;
server_name mysite.me www.mysite.me;
charset utf-8;
client_max_body_size 75M;
location /media {
alias /srv/mysite/mysite/media;
}
location /static {
alias /srv/mysite/static;
}
location / {
uwsgi_pass django;
include /etc/nginx/uwsgi_params;
}
}
[uwsgi]
chdir = /srv/mysite
module = mysite.wsgi:application
plugin = python
# http = 0.0.0.0:8000 - use this to test uwsgi directly without nginx frontend
socket = /tmp/mysite.sock
chmod-socket = 664
vacuum = true
master = true
need-app = true
processes = 10
harakiri = 20
max-requests = 5000
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question