加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

在django nginx wsgi中,什么是“mysite.sock”

发布时间:2020-12-13 21:28:29 所属栏目:Nginx 来源:网络整理
导读:我知道我的问题一定是非常愚蠢的,因为我无法找到任何关于它的事情,即使是堆栈溢出,但这真的是一个问题. 我跟着this doc,几乎一切顺利,直到“mysite.sock”发生.这样发生: server unix:///path/to/your/mysite/mysite.sock; # for a file socket# server 127

我知道我的问题一定是非常愚蠢的,因为我无法找到任何关于它的事情,即使是堆栈溢出,但这真的是一个问题.

我跟着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”的信息,经过一天的搜索,我没有发现任何内容,而我的django网站需要在48小时内上网,所以我必须要求帮助.

最佳答案
我不是这方面的专家,但是我已经用这种方法在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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读