玩蛇网提供最新Python编程技术信息以及Python资源下载!

请问Nginx+uwsgi+django后端sock文件丢失解决方法是什么

uwsgi的配置文件如下

[uwsgi]
  chdir=/home/dev/workplace/xjc
  module=xjc.wsgi:application
  #master=True
  #pidfile=/tmp/project-master.pid
  socket=/home/dev/workplace/xjc/xjc.sock
  vacuum=True
  max-requests=5000
  daemonize=/home/dev/workplace/xjc/static/log/uwsgi.log

uwsgi_params文件内容如下

uwsgi_param     QUERY_STRING            $query_string;
uwsgi_param     REQUEST_METHOD          $request_method;
uwsgi_param     CONTENT_TYPE            $content_type;
uwsgi_param     CONTENT_LENGTH          $content_length;

uwsgi_param     REQUEST_URI             $request_uri;
uwsgi_param     PATH_INFO               $document_uri;
uwsgi_param     DOCUMENT_ROOT           $document_root;
uwsgi_param     SERVER_PROTOCOL         $server_protocol;
uwsgi_param     UWSGI_SCHEME            $scheme;

uwsgi_param     REMOTE_ADDR             $remote_addr;
uwsgi_param     REMOTE_PORT             $remote_port;
uwsgi_param     SERVER_PORT             $server_port;
uwsgi_param     SERVER_NAME             $server_name;

nginx的配置文件如下

upstream django {
        server unix:///home/dev/workplace/xjc/xjc.sock;           
}

server {
        listen      80;
        charset     utf-8;

        client_max_body_size 75M;  

        root    /home/dev/workplace/xjc/www; 

        location /static {
                alias /home/dev/workplace/xjc/static ;
        }

        location /api {
                uwsgi_pass  django;
                include     /home/dev/workplace/xjc/uwsgi_params; 
        }

        location /admin {
                uwsgi_pass  django;
                include     /home/dev/workplace/xjc/uwsgi_params; 
        }

        location / {
                index /home/dev/workplace/xjc/www/index.html;
        }
}

玩蛇网文章,转载请注明出处和文章网址:https://www.iplaypy.com/wenda/wd18618.html

相关文章 Recommend

玩蛇网Python互助QQ群,欢迎加入-->: 106381465 玩蛇网Python新手群
修订日期:2017年05月21日 - 17时04分59秒 发布自玩蛇网

您现在的位置: 玩蛇网首页 > Python问题解答 > 正文内容
我要分享到:

必知PYTHON教程 Must Know PYTHON Tutorials

必知PYTHON模块 Must Know PYTHON Modules