[python] flask + ngnix

文本记录了当使用python+flask的应用时,如何配合ngnix实现通过80端口访问,从而也就可以使用域名直接访问python app。

https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-16-04

评论中有502错误解决方法。

如果有多个app,virtualenv可以共用,只要在service的路径里面写上实际路径即可

virtualenv webprojectenv

source webprojectenv/bin/activate

502

For those that have the 502 gateway error try changing chmod-socket = 660

uwsgi_pass unix:///home/sammy/myproject/myproject.sock;