使用uWSGI服务器运行NGINX时出现连接错误

时间:2016-03-28 09:27:10

标签: python unix nginx uwsgi

Nginx在机器1中运行,具有以下配置:

daemon off;

worker_processes 1 ;

events
{
     worker_connections 1024;
}

http {


log_format upstream_time '$remote_addr - $remote_user [$time_local] '
                         '"$request" $status $body_bytes_sent '
                         '"$http_referer" "$http_user_agent"'
                         'rt=$request_time urt="$upstream_response_time"';

access_log /u/user1/logs/access.log upstream_time;

server {

   listen 7876;

   server_name NGINSERVER;

   location /d {
        include         /etc/nginx/uwsgi_params;
        uwsgi_pass      <UWSGIRUNNINGMACHINENAME>:7877;
        uwsgi_read_timeout  30s;
    }
}
uWSGI在机器2中运行,具有以下配置:

[d]
master = true
workers = 5
socket = 127.0.0.1:7877
chmod-socket = 664
vacuum = true
die-on-term = true
close-on-exec = true
chdir = /u/user1/prpject/src
module = test.run

如果我在同一台机器上启动NGINX和uWSGI,则表示连接已成功建立。

当我尝试在不同的机器上运行时,问题就开始了,

  

2016/03/28 05:13:44 [错误] 370#0:* 16连接()到unix:/u/user1/socks/data.sock失败(111:拒绝连接),同时连接到上游, client:xxx.xx.xxx.xx,server:NGINserver,request:&#34; GET / data / 20160305 HTTP / 1.1&#34;,upstream:&#34; uwsgi:// unix:/ u / user1 / socks / data.sock:&#34;,主持人:&#34; domain.com:7876&#34;

请帮忙!

0 个答案:

没有答案