Skip to content

Instantly share code, notes, and snippets.

@xdtianyu
Created March 18, 2015 07:13
Show Gist options
  • Save xdtianyu/eb81a1babca5c7b6cedb to your computer and use it in GitHub Desktop.
Save xdtianyu/eb81a1babca5c7b6cedb to your computer and use it in GitHub Desktop.
uwsgi nginx flask deploy
$apt-get install nginx python-dev libpcre3 libpcre3-dev
$pip install uwsgi
$cat uwsgi.ini
[uwsgi]
socket = /tmp/flask.sock
chmod-sock = 666
module = server
callable = app
enable-threads = true
thunder-lock = true
master = true
uid = www-data
gid = www-data
processes = 2
#logger = file:/var/log/flask.log
daemonize = /var/log/flask.log
pidfile = /tmp/flask.pid
#uwsgi -s /tmp/flask.sock --chmod-sock=666 --module server --callable app --enable-threads --thunder-lock --master --uid=www-data --gid=www-data
$$$$$
nginx location config
location /flask {
include uwsgi_params;
uwsgi_pass unix:/tmp/flask.sock;
uwsgi_param SCRIPT_NAME /flask;
uwsgi_modifier1 30;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment