Skip to content

Instantly share code, notes, and snippets.

View kizniche's full-sized avatar

Kyle Gabriel kizniche

View GitHub Profile
@kizniche
kizniche / flask_nginx_gunicorn.md
Created December 22, 2017 01:01 — forked from xaratustrah/flask_nginx_gunicorn.md
Flask nginx gunicorn Raspberry Pi

Python Flask + nginx + gunicorn

Setting up a python flask web application using nginx, gunicorn and systemd on a Rasperry Pi

In the following, we assume a working Flask application with the name of SCRIPT_NAME. First we need to install a couple of things:

sudo apt-get update && sudo apt-get upgrade

Installing nginx will fail if apache is running. If your installation breaks half ways, then remove the fragments, stop apache (and I actually suggest removing it in case not needed) and then install nginx again:

sudo apt-get remove nginx* --purge

sudo /etc/init.d/apache2 stop