Django&nginx&uwsgi无法连接

2024-09-28 01:59:37 发布

您现在位置:Python中文网/ 问答频道 /正文

是我的nginx.conf公司在

# nginx.conf
# the upstream component nginx needs to connect to 
upstream django {
    server unix:///home/user/djangosite/project/project.sock;
    # server 127.0.0.1:8001; # for a web port socket
}

# configuration of the server
server {
    # the port your site will be served on
    listen      8000;
    # the domain name it will serve for
    server_name .example.com; # substitute your machine's IP address or FQDN
    charset     utf-8;

    # max upload size
    client_max_body_size 75M;   # adjust to taste

    # Django media
    location /media  {
        alias /home/user/djangosite/project/media;  # your Django project's media files - amend as required
    }

    location /static {
        alias /home/user/djangosite/project/static; # your Django project's static files - amend as required
    }

    # Finally, send all non-media requests to the Django server.
    location / {
        uwsgi_pass  django;
        include     /home/user/djangosite/project/uwsgi_params; # the uwsgi_params file you installed
    }
 }

它是我的uwsgi.ini文件在

^{pr2}$

这是我的uwsgi日志

*** Starting uWSGI 2.0.14 (64bit) on [Mon Mar 27 23:34:22 2017] ***
compiled with version: 5.4.0 20160609 on 16 March 2017 00:34:31
os: Linux-4.8.0-41-generic #44~16.04.1-Ubuntu SMP Fri Mar 3 17:11:16 UTC 2017
nodename: user-VirtualBox
machine: x86_64
clock source: unix
detected number of CPU cores: 2
current working directory: /home/user/djangosite/project
detected binary path: /home/user/djangosite/django_virtual/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /home/user/djangosite/project
your processes number limit is 7833
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /home/user/djangosite/project/project.sock fd 3
Python version: 3.6.0 (default, Mar 16 2017, 00:24:05)  [GCC 5.4.0 20160609]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x1efd260
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 800448 bytes (781 KB) for 10 cores
*** Operational MODE: preforking ***
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x1efd260 pid: 12449 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 12449)
spawned uWSGI worker 1 (pid: 12451, cores: 1)
spawned uWSGI worker 2 (pid: 12452, cores: 1)
spawned uWSGI worker 3 (pid: 12453, cores: 1)
spawned uWSGI worker 4 (pid: 12454, cores: 1)
spawned uWSGI worker 5 (pid: 12455, cores: 1)
spawned uWSGI worker 6 (pid: 12456, cores: 1)
spawned uWSGI worker 7 (pid: 12457, cores: 1)
spawned uWSGI worker 8 (pid: 12458, cores: 1)
spawned uWSGI worker 9 (pid: 12459, cores: 1)
spawned uWSGI worker 10 (pid: 12460, cores: 1)
SIGINT/SIGQUIT received...killing workers...
worker 1 buried after 1 seconds
worker 2 buried after 1 seconds
worker 3 buried after 1 seconds
worker 4 buried after 1 seconds
worker 5 buried after 1 seconds
worker 6 buried after 1 seconds
worker 7 buried after 1 seconds
worker 8 buried after 1 seconds
worker 9 buried after 1 seconds
worker 10 buried after 1 seconds

当我执行“uwsgi--ini”时uwsgi.ini文件“,我无法连接到正确的页面。 显示错误连接被拒绝。 我不知道怎么解决这个问题,请帮帮我


Tags: toprojecthomeyourpidcoresuwsgiworker

热门问题