如何使用Nginx部署python项目?

时间:2015-05-25 13:35:50

标签: python nginx socket.io server

我写了一个client.py和一个server.py,他们用socket(而不是websocket)TCP连接互相交谈。这是一个C / S应用程序。现在我想使用nginx来部署服务器,但我不知道该怎么做。我已经浏览了一些关于nginx的资料,这只是讨论如何部署websocket。

任何建议都会很感激。谢谢。

2 个答案:

答案 0 :(得分:1)

如果您想使用HTTP(s)协议在您的客户端和服务器之间进行通信,Nginx将只会帮助您。 Python人通常使用WSGI来完成它。如今,流行的配对是NGIX + Gunicorn。

以下是有关如何使用NGINX http://gunicorn-docs.readthedocs.org/en/latest/deploy.html

设置Gunicorn的文档参考

答案 1 :(得分:0)

Here是如何为template<class T> friend void printVar(const MyVar&); template<class T> friend void scanVar(MyVar&); // compilation error template<class T> friend void printVar(const MyVar<T>&); template<class T> friend void scanVar(MyVar<T>&); // compilation error friend void printVar(const MyVar<T>&); friend void scanVar(MyVar<T>&); // link error friend void printVar(const MyVar&); friend void scanVar(MyVar&); // link error too 完成的。您还没有分享您的代码,因此不能说太多。