Created
March 18, 2015 07:13
-
-
Save xdtianyu/eb81a1babca5c7b6cedb to your computer and use it in GitHub Desktop.
uwsgi nginx flask deploy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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