如何使用 Nginx 部署 python 项目?

How to deploy a python project with Nginx?

我写了一个 client.py 和一个 server.py,它们通过套接字(不是 websocket)相互通信 TCP connection.This 是一个 C/S 应用程序。现在我想用nginx来部署服务器,但我不知道该怎么做。 nginx的一些material看了一些,只是讲如何部署websocket

任何建议都是appreciate.Thanks。

HereSimpleHTTPServer 的处理方式。你还没有分享你的代码,所以不能说太多。

Nginx 只会在您想要使用 HTTP(s) 协议在您的客户端和服务器之间进行通信时帮助您。 Python 人们通常用 WSGI 来做。最近流行的组合是 NGIX + Gunicorn。

这是关于如何使用 NGINX 设置 Gunicorn 的文档参考 http://gunicorn-docs.readthedocs.org/en/latest/deploy.html