You need to install nginx, uwsgi and uwsgi-plugin-python (or uwsgi-plugin-python3)
Create /etc/nginx/sites-available/project
and create a link to it in /etc/nginx/sites-enabled/project
server {
listen 80;
server_name domain.com;
client_max_body_size 5m;
access_log /var/log/nginx/project.access.log;
error_log /var/log/nginx/project.error.log;
location /static/ {
gzip_static on;
alias /home/project/static/;
}
location /media/ {
gzip_static on;
alias /home/project/media/;
}
location / {
gzip_static on;
include uwsgi_params;
uwsgi_pass unix:/var/run/uwsgi/app/project/socket;
}
}
Create /etc/uwsgi/apps-available/project.ini
and create a link to it in /etc/uwsgi/apps-enabled/project.ini
[uwsgi]
plugins = python
home = /home/wille/.virtualenvs/projectenv/
chdir = /home/project/
pythonpath = ..
env = DJANGO_SETTINGS_MODULE=project.settings
module = project.wsgi:application
touch-reload = /home/project/uwsgi_reload
LANG = en_US.UTF-8
max-requests=5000
socket=127.0.0.1:8084
uid = wille
gui = users
processes = 4
threads = 2
Execute touch /home/project/uwsgi_reload
and remember to change the port in the socket parameter to each application you deploy.