- NGINX Cookbook
- Tim Butler
- 88字
- 2025-04-04 18:27:16
Getting ready
This recipe is based on a very simple, single file Flask application. To show the simplicity, here's the example (demoapp.py) we'll use:
from flask import Flask application = Flask(__name__) @application.route("/") def hello(): return "<h1>Demo via Nginx with uWSGI!</h1>" if __name__ == "__main__": application.run(host='127.0.0.1', port=9001)
Like the Django recipe, we're going to use uWSGI for the application server in this scenario as well. If you haven't installed uWSGI yet, the best way is to install the latest version via pip:
apt-get install python-pip python-dev
pip install uwsgi