Nginx+gunicorn+supervisor+flask @ CentOS

Source: Internet
Author: User

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

server {listen 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_flaskuser=root autostart=true autorestart=true stdout_logfile=/home/www/my_flask/logs/ Gunicorn_supervisor.log

/home/www/my_flask/gunicorn.conf

Workers=3bind = ' 127.0.0.1:8000 '

  

Nginx+gunicorn+supervisor+flask @ CentOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.