nginx
server {
listen 8080 default_server;
listen [::]:8080 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $url=/404.html @helloworld;
#try_files $uri $uri/ @helloworld =404;
try_files $uri $uri/ @helloworld;
}
location @helloworld {
include uwsgi_params;
uwsgi_pass unix:/tmp/dawnsea.sock;
}
uwsgi
[uwsgi]
uid=www-data
gid=www-data
chdir = /home/dawnsea/works/flask/kblog
master = true
processes = 5
socket = /tmp/dawnsea.sock
chmod-socket = 666
vacuum = true
callable = app
module = runserver
daemonize = /tmp/uwsgi.log
uwsgi kblog.ini –py-autoreload 1
flask
#-*- coding: utf-8 -*-
from tblog import app
if __name__ == '__main__':
app.run(debug=True)