gunicorn 시작 django

1677 단어
gunicorn.conf.py

import logging
import logging.handlers
from logging.handlers import WatchedFileHandler
import os
import multiprocessing

bind = "127.0.0.1:8000"   #   ip   
backlog = 512                #      ,64-2048
worker_class = 'sync' #  gevent  ,     sync   ,    sync  
workers = 4 # multiprocessing.cpu_count()    #   
threads = 16 #multiprocessing.cpu_count()*4 #            
loglevel = 'info' #    ,                ,            
access_log_format = '%(t)s %(p)s %(h)s "%(r)s" %(s)s %(L)s %(b)s %(f)s" "%(a)s"'

accesslog = "-"  #      ,"-"       
errorlog = "-"   #      ,"-"       

proc_name = 'eashop'   #   

시작 명령:
 /root/python/bin/gunicorn  -c gunicorn.conf.py EA_Shop.wsgi:application
#EA_Shop   wsgi.py     

nginx.conf
server {
       listen 80;
       server_name cloud.fxeye.com;
       client_max_body_size 50m;
      location /static {
     alias /*/static/;
     }
      location / {
               proxy_set_header x-Real-IP $remote_addr;
               proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
               proxy_set_header Host $http_host;
               proxy_pass http://localhost:8000;
               #include uwsgi_params;
               #uwsgi_pass 127.0.0.1:8000;
               #proxy_pass_header Server;
                #####   websocket
                proxy_redirect off;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
}
}

좋은 웹페이지 즐겨찾기