1. wsgi 설치 (web server gateway interface)

   pip install uwsgi



2. uwsgi.ini 구성

[uwsgi] 

socket = 127.0.0.1:8000 

uid=www-data 

gid=www-data 

chdir=/var/www/djangodemo 

module=djangodemo.wsgi 

master=True 

pidfile=/tmp/uwsgi-djangodemo.pid 

vacuum=True 

max-requests=5000 

daemonize=/var/log/uwsgi/djangodemo.log 


3. nginx 설정

server { 

    listen       80; 

    server_name  localhost; 

 

    access_log  /var/log/nginx/djangodemo-access.log  combined; 

 

    location = /favicon.ico { access_log off; log_not_found off; } 

 

    location /static|/media { 

        root /var/www/djangodemo/; 

    } 

 

    location / { 

        include         uwsgi_params; 

        uwsgi_pass      127.0.0.1:8000; 

    } 






'오픈소스 > nginx' 카테고리의 다른 글

nginx for beego  (0) 2018.02.02
nginx for http2  (0) 2018.02.02
nginx ssl 설정  (0) 2018.02.02
nginx for flask  (0) 2018.02.02
nginx for express  (0) 2018.01.29

+ Recent posts