Deploying Nginx + Gunicorn + FlaskWhy use both Nginx and Gunicorn?: http://serverfault.com/a/220047
Simple explanation: http://prakhar.me/articles/flask-on-nginx-and-gunicorn/
Nginx SSL configuration: https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-with-ssl-as-a-reverse-proxy-for-jenkins
The thing I spent the longest on was getting supervisor to work. Gunicorn kept giving me "gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>", because I was missing the "directory" parameter. I needed to tell supervisor which directory to start from.
command=/<path>/venv/prod/bin/gunicorn -w 8 main:app -b 127.0.0.1:8080
You will need to create an upstart script to get supervisor to run when the system starts: http://serverfault.com/a/96500