- NGINX Cookbook
- Tim Butler
- 88字
- 2021-07-03 00:04:30
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
推薦閱讀
- 大學(xué)計(jì)算機(jī)應(yīng)用基礎(chǔ)實(shí)踐教程
- 微服務(wù)與事件驅(qū)動(dòng)架構(gòu)
- PostgreSQL for Data Architects
- Developing Middleware in Java EE 8
- Raspberry Pi 2 Server Essentials
- Julia Cookbook
- 零基礎(chǔ)學(xué)Python數(shù)據(jù)分析(升級(jí)版)
- FFmpeg入門詳解:音視頻原理及應(yīng)用
- Mastering Linux Security and Hardening
- Java EE企業(yè)級(jí)應(yīng)用開發(fā)教程(Spring+Spring MVC+MyBatis)
- Programming Microsoft Dynamics? NAV 2015
- Learning Nessus for Penetration Testing
- PHP Microservices
- Web前端開發(fā)精品課:HTML5 Canvas開發(fā)詳解
- Natural Language Processing with Python Cookbook