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

前端之家收集整理的这篇文章主要介绍了在django nginx wsgi中,什么是“mysite.sock”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

我跟着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.

原文链接:https://www.f2er.com/nginx/434629.html

猜你在找的Nginx相关文章