Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Nginx和uwsgi不使用unix套接字_Unix_Nginx_Uwsgi - Fatal编程技术网

Nginx和uwsgi不使用unix套接字

Nginx和uwsgi不使用unix套接字,unix,nginx,uwsgi,Unix,Nginx,Uwsgi,我正在尝试在nginx和uwsgi中使用unix套接字,但它对我不起作用,但是没有unix套接字它就起作用了 uwsgi --socket test_django_uwsgi.sock --protocol=http --virtualenv /home/ubuntu/myenv27/ --wsgi-file wsgi.py nginx.conf server { # the port your site will be served on listen 80;

我正在尝试在nginx和uwsgi中使用unix套接字,但它对我不起作用,但是没有unix套接字它就起作用了

uwsgi --socket test_django_uwsgi.sock --protocol=http --virtualenv /home/ubuntu/myenv27/ --wsgi-file wsgi.py
nginx.conf

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

    access_log  /home/ubuntu/test_django/nginx-access.log;
    error_log  /home/ubuntu/test_django/nginx-error.log info;


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

    # Django media
    location /media  {
    alias /home/ubuntu/test_django/static/media/;  # your Django project's media files - amend as required
    }

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

    # Finally, send all non-media requests to the Django server.
    location / {
    #uwsgi_pass  127.0.0.1:8000;
    uwsgi_pass  unix:///home/ubuntu/test_django/test_django/test_django_uwsgi.sock;
    include  /home/ubuntu/test_django/uwsgi_params; # the uwsgi_params file you installed
    }
}
uwsgi.log

*** Starting uWSGI 2.0.11.1 (64bit) on [Fri Sep 18 08:41:28 2015] ***
compiled with version: 4.8.4 on 17 September 2015 21:29:55
os: Linux-3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015
nodename: ip-172-31-35-204
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/ubuntu/test_django/test_django
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 7858
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 TCP address :test_django_uwsgi.sock fd 3
Python version: 2.7.6 (default, Jun 22 2015, 18:01:27)  [GCC 4.8.2]
Set PythonHome to /home/ubuntu/myenv27/
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x1e66460
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72760 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1e66460 pid: 13117 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 13117, cores: 1)

当我试图访问www.example.com:8000时,我的网站没有打开

我也检查了错误日志,但什么都没有..什么意思网站不打开?404/502/503或超时错误?@Anatoly此网页不可用错误。。Chromium与www.example.com的连接尝试被拒绝。网站可能已关闭,或者网络配置不正确。嗯,好的。在配置错误的uwsgi的情况下,您应该看到502,如果位置配置不正确,则显示404。否则,问题出现在较低级别(DNS)或网络上。@Anatoly客户端在等待请求时关闭了连接,客户端:202.89.104.26,服务器:0.0.0.0:80在nginx错误日志中