How To Serve Flask Applications on Nginx withOUT uWSGI

How is it going to work ?

Figure 1.1: How the idea is going to work seen from the outside

Prerequisites

Step 1 — Run the Flask app

Figure 1.2: an example of flask app
Figure 1.3: Screenshot from console after running the flask app.

Step 2 — Ngnix configuration

upstream learn_server{
server 127.0.0.1:5000;
}
location /flask_app {
proxy_pass http://learn_server;
proxy_http_version 1.1;
proxy_set_header Connection "";
}}
 yourwebsite/flask_app/learn/hello  => ngnix_server
ngnix_server => 127.0.0.1/learn/hello

--

--

Full Stack Developer| Loading…

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store