2016年uwsgi+nginx+django配置方案

uwsgi

django项目目录下创建uwsgi.ini

[uwsgi]
socket = 127.0.0.1:8001
master = true
processes = 5
chdir=/home/bug/PycharmProjects/JEW/
env = DJANGO_SETTINGS_MODULE=JEW.settings
module = JEW.wsgi:application
virtualenv = /home/bug/PycharmProjects/JEW/ENV
enable-threads= True
thunder-lock= True

nginx

编辑/etc/nginx/sites-available/default为如下内容

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    index index.html index.htm index.nginx-debian.html;
    server_name _;
    location / {
        include uwsgi_params;
            uwsgi_pass 127.0.0.1:8001;
    }
    location /site_media {
        alias /home/bug/PycharmProjects/JEW/JEW/site_media/static/;
    }
}
    原文作者:Prasanta
    原文地址: https://segmentfault.com/a/1190000006234959
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞