deploy flask with nginx on ubuntu
- Configure nginx
- configure flask app
Configure nginx
First, install nginx using apt-get install nginx
.
修改/etc/nginx/sites-enabled/default,改文件名成xxx.com后修改内容
1 | listen 80; |
使用软连接把文件连接到sites-available里
Configure flask app
In app.py need to use app.run(host='0.0.0.0')
so all
access can be done through ip:5000