码迷,mamicode.com
首页 > 其他好文 > 详细

nginx+gunicorn+supervisor+flask @ centos

时间:2016-04-18 11:24:48      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:

/etc/nginx/conf.d/default.conf

server {
listen 80 default_server;
server_name 127.0.0.1;

#charset koi8-r;

#access_log logs/host.access.log main;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
root /home/www/my_flask;
index index.html index.htm;
try_files $uri @gunicorn_proxy;
}

location @gunicorn_proxy {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:8000;
}

  

/etc/supervisord.conf

[program:my_flask] 
command=/home/www/my_flask/venv/bin/gunicorn runserver:app -c /home/www/my_flask/gunicorn.conf 
directory=/home/www/my_flask
user=root 
autostart=true 
autorestart=true 
stdout_logfile=/home/www/my_flask/logs/gunicorn_supervisor.log

 

/home/www/my_flask/gunicorn.conf  

workers=3
bind = ‘127.0.0.1:8000‘

  

 

nginx+gunicorn+supervisor+flask @ centos

标签:

原文地址:http://www.cnblogs.com/turingbrain/p/5403489.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!