我关注了this doc ,几乎一切顺利,直到“mysite.sock”出现。它是这样发生的:
server unix:///path/to/your/mysite/mysite.sock; # for a file socket
# server 127.0.0.1:8001; # for a web port socket (we'll use this first)
这个文档没有提到任何关于“mysite.sock”的内容,经过一天的搜索,我什么也没找到。
最佳答案
我不是这方面的专家,但我已经通过这种方法在 Nginx 上使用 uWSGI 部署了 Django。一个套接字文件代表一个 Unix 套接字。在这种情况下,uWSGI 创建它,uWSGI 和 Nginx 将通过这个套接字相互通信。
您提供的链接的“Concept”部分讨论了它:
uWSGI is a WSGI implementation. In this tutorial we will set up uWSGI so that it creates a Unix socket, and serves responses to the web server via the WSGI protocol. At the end, our complete stack of components will look like this:
the web client <-> the web server <-> the socket <-> uwsgi <-> Django
教程的第一部分讨论了使用 TCP 端口套接字来实现相同的结果。如果您已经遵循了这些步骤,那么您应该跳过 Unix 套接字部分。但是,它也提到Unix sockets are better due to less overhead .
关于django - 在 django + nginx + wsgi 中, "mysite.sock"是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23148082/