uwsig.ni 配置:python
[uwsgi] master=true socket=127.0.0.1:9001 home=/opt/www/env-0.1 註釋:這個應該是一個virtualenv的home路徑 processes=4 enable-threads=true threads=4 socket-timeout=300 reload-mercy=10 vacuum=true max-requests=5000 limit-as=512 buffer-size=30000 daemonize=/var/log/uwsgi.log memory-report=true chdir=/opt/www 註釋:這個應該是Django項目的根路徑 pythonpath=/opt/www/setting 註釋:這個應該是Django項目setting.py所在的文件夾路徑 module=wsgi logformat=%(addr) - "%(user)" [%(ltime)] %(host) %(method) "%(uri)" %(proto) %(status) %(micros) %(size) "%(referer)" "%(uagent)"
nginx 配置:nginx
server { listen 80; charset utf-8; root /tmp; location / { uwsgi_pass 127.0.0.1:9001; include uwsgi_params; } }