文章目录
  1. 1. nginx config
  2. 2. uwsgi install
  3. 3. uwsgi config
  4. 4. start uwsgi
  5. 5. ref

use flask uwsgi nginx to deploy a web application

nginx config

1
2
3
4
5
6
7
8
9
10
server{
listen 8000;
server_name your domain;

location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9090;
uwsgi_param UWGI_SCRIPT manage:app;
}
}

uwsgi install

WSGI quickstart

1
pip install uwsgi

uwsgi config

1
2
3
4
5
6
7
8
9
10
11
[uwsgi]

socket = 127.0.0.1:9090
processes = 4
threads = 2
master = true
wsgi-file = /home/jay/Documents/python/flask/dy.py
module = manage
callable = app
memory-report = true
daemonize = /home/jay/Documents/python/flask/server.log

start uwsgi

1
2
3
uwsgi uwsgi-config.ini

uwsgi --socket :9090 --plugin python --wsgi-file foobar.py

ref

文章目录
  1. 1. nginx config
  2. 2. uwsgi install
  3. 3. uwsgi config
  4. 4. start uwsgi
  5. 5. ref
Fork me on GitHub