csdn/CSDN博文备份/PythonWeb服务器网关接口-143031801.md
2024-10-18 01:30:53 +08:00

1 line
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>gunicorn 是 WSGI。</p> <br><p>因其中一个项目说是要用 gunicorn ,然后就顺便了解下 gunicorn 这个东西是干什么的。</p> <br><p>要想了解 gunicorn ,那么就需要知道 WSGI 是什么东西。</p> <br><p>开始都不知道 WSGI 是什么概念,还以为是个新东西。</p> <br><p>其实就是 Python 实现的网络接口Python 的反向代理。</p> <br><p>Web 服务器网关接口Python Web Server Gateway Interface缩写为WSGI是为Python语言定义的Web服务器和Web应用程序或框架之间的一种简单而通用的接口。自从WSGI被开发出来以后许多其它语言中也出现了类似接口。</p> <br><p>以前如何选择合适的Web应用程序框架成为困扰Python初学者的一个问题这是因为一般而言Web应用框架的选择将限制可用的Web服务器的选择反之亦然。</p> <br><p>那时的Python应用程序通常是为CGIFastCGImod_python中的一个而设计甚至是为特定Web服务器的自定义的API接口而设计的。</p> <br><p></p> <br><p class="img-center"><a href="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR_1IG6gVqz4elNUC6Su9pt2cFWez7tb0ThCQ&s" rel="nofollow"><img alt="" height="118" src="https://img-blog.csdnimg.cn/img_convert/967abc968442dae2747888d771ba2aac.jpeg" width="427" /></a></p> <br><p>WSGI有时发音作wiz-gee是作为Web服务器与Web应用程序或应用框架之间的一种低级别的接口以提升可移植Web应用开发的共同点。WSGI是基于现存的CGI标准而设计的。</p> <br><p>Gunicorn是基于unix系统被广泛应用的高性能的Python WSGI HTTP Server。 <strong>用来解析HTTP请求的网关服务</strong></p> <br><p>它通常是在进行反向代理如nginx或者进行负载均衡如AWS ELB和一个web 应用比如Django 或者Flask之间。</p> <br><p><a href="https://www.isharkfly.com/t/python-web/16437" rel="nofollow" title="Python Web服务器网关接口 - Python - iSharkFly">Python Web服务器网关接口 - Python - iSharkFly</a></p>