简体   繁体   English

部署Sanic Raw

[英]Deploying Sanic Raw

Sanic appears to be a highly perfomant web framework (server) for Python. Sanic似乎是适用于Python的高性能Web框架(服务器)。 From experience with other frameworks, including Flask and Django I know that it is generally recommended to put the Python server behind another server (eg reverse Proxy) like Nginx for security reasons. 根据包括Flask和Django在内的其他框架的经验,我知道出于安全原因,通常建议将Python服务器放置在另一个服务器(例如,反向代理)之后,例如Nginx。 How does that translate to Sanic, or a gunicorn server running Sanic? 这如何转换为Sanic或运行Sanic的Gunicorn服务器? Does someone have experience with that. 有人有经验吗? I wonder if it is safe to expose a Python server to the web. 我想知道将Python服务器公开到网络是否安全。

I haven't deployed sanic to a prod environment yet, but previous deploys followed the following logic: 我尚未将sanic部署到产品环境,但是先前的部署遵循以下逻辑:

Internet <-> Nginx <-> Uwsgi (or gunicorn) <-> python framework (django or other framework) 互联网<-> Nginx <-> Uwsgi(或gunicorn)<-> python框架(Django或其他框架)

According to this Deploy Sanic you can launch sanic with multiple workers and behind gunicorn. 根据此Deploy Sanic的部署,您可以与多个工作人员并在gunicorn后面启动sanic。

So I am guessing nginx <-> gunicorn <-> gunicorn myapp:app --bind 0.0.0.0:8080 --worker-class sanic.worker.GunicornWorker 所以我猜nginx <-> gunicorn <-> gunicorn myapp:app --bind 0.0.0.0:8080 --worker-class sanic.worker.GunicornWorker

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM