WSGI, uWSGI, uwsgi, nginx

注:经过调研发现,网络上对于此四者关系的描述不尽相同,有的甚至相差甚远,对于官方的一些资料及对比一些博客,得出以下认识,如有偏颇之处,望不吝指正。

用一张图可以清晰的展示四者的关系(此图摘自网络):

Python web应用的访问过程

1. WSGI

WSGI(Web Server Gateway Interface)即Web服务器网关接口,它不是任何软件,而是一种通信协议(PEP3333)。

The availability and widespread use of such an API in web servers for Python – whether those servers are written in Python (e.g. Medusa), embed Python (e.g. mod_python), or invoke Python via a gateway protocol (e.g. CGI, FastCGI, etc.) – would separate choice of framework from choice of web server, freeing users to choose a pairing that suits them, while freeing framework and server developers to focus on their preferred area of specialization.

This PEP, therefore, proposes a simple and universal interface between web servers and web applications or frameworks: the Python Web Server Gateway Interface (WSGI).

其目的是为了使框架和web服务器分离,使实现了WSGI的框架和web服务器可以自由搭配。

2.uWSGI

uWSGI是一个web服务器,实现了WSGI协议,这样它就可以和实现了WSGI协议的框架进行通信(PEP3333)。

3.uwsgi

uwsgi是一种线路协议而不是通信协议,在此常用于在uWSGI服务器与其他网络服务器的数据通信(如nginx)。uwsgi协议是一个uWSGI服务器自有的协议,它用于定义传输信息的类型。

4.nginx

一个高性能的web服务器

综上所述:WSGI是一种框架与web服务器间通信的协议,uwsgi是uWSGI与其他web服务器通信的协议,uWSGI是一个web服务器,也可以作为中间件使用,nginx是一个web服务器

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值