How to structure and deploy an Angular2 app with a Flask back-end api while using Nginx and Gunicorn.

December 26, 2016 10.5k views
Python Frameworks Nginx Deployment Ubuntu 16.04

I'm having a Linux based Droplet(Ubuntu 16.04). I need to know the application structure to follow. Also, where should the Nginx root point to; and if possible the custom server block config for the Nginx server.

1 Answer

I would recommend starting with this guide to deploy your flask API.

With your Angular2 app running on the same droplet you should be able to add a second Location block in your nginx configuration using proxypass to pass through communications to angular. This guide provides some examples of nginx proxypass configuration for another service running on it's own port on the same droplet.

by Justin Ellingwood
In this guide, we will be setting up a simple Python application using the Flask micro-framework on Ubuntu 16.04. The bulk of this article will be about how to set up the Gunicorn application server to launch the application and Nginx to act as a front end reverse...
Have another answer? Share your knowledge.