夜华家居装饰网,单项奖学金申请书,团代会贺词
gunicorn
安装:pip install gunicorn
nginx
安装:sudo apt-get install nginx
nginx默认配置信息在/etc/nginx/sites-enabled/default
server { listen 8300 default_server;#默认端口设置位置 listen [::]:8300 default_server ipv6only=on; root /usr/share/nginx/html; index 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 $uri/ =404; # uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } server { listen 8200;#nginx对外监听端口设置 server_name my.com;#网站域名绑定 #root html; #index index.htm; location /auth {#auth为flask程序你的蓝图,如果没有设置蓝图则为/ #try_files $uri $uri/ =404; proxy_pass http://0.0.0.0:8100;#gunicorn启动flask的网址 proxy_set_header host $host; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; client_max_body_size 50m;#服务器上传文件大小上限 } location /static {#静态文件static文件夹所在目录 root /var/www/mission-manager/; } }
/var/www/
gunicorn -w 2 -b 127.0.0.0:8100 mission-manager:app
,-w
进程数量,mission-manager
为flask
程序主函数所在py
文件nginx
服务:service nginx start
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Python爬虫:Request Payload和Form Data的简单区别说明
浅谈Python中threading join和setDaemon用法及区别说明
Python3-异步进程回调函数(callback())介绍
python继承threading.Thread实现有返回值的子类实例
Python中使用threading.Event协调线程的运行详解
网友评论