Setup a Reverse Proxy on Nginx for Your Backend Applications
Nginx is a great product! And today we will use nginx to setup a http reverse proxy to access our backend applications.
Our Setup
We will have a flask backend application listening on 127.0.0.1:5000 and our nginx reverse proxy will listen on 0.0.0.0:80 which will proxy requests through to our flask upstream.
Our Backend Application
Our Flask application:
123456789
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello'
if __name__ == '__main__':
app.run(host='127.0.0.1', port=5000)