Nginx 服务器:上游超时(10060:连接尝试失败)

Jee*_*han 6 php mysql nginx

我们正在运行一个服务,它将问题从 Jira 迁移到测试链接。所以我使用 nginx 服务器与 mysql 数据库进行通信并在浏览器中运行测试链接。

当我突然导入更多问题时,nginx 服务器会自动关闭。我在 Windows Server 2008 R2 标准和 64 位操作系统中运行我的服务和 nginx 服务器。我检查了 error.log 文件C:\nginx\logs,发现错误为

上游超时(10060:连接尝试失败,因为连接方在一段时间后没有正确响应,或者由于连接的主机未能响应而建立连接失败)连接上游时,客户端:192.168.27.151,服务器:本地主机, request: "GET /testlink/lib/general/frmWorkArea.php?feature=reqSpecMgmt HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "wo-qatestlink01", referrer: " http ://wo-qtestlink01/testlink/lib/general/navBar.php?tproject_id=0&tplan_id=0&updateMainPage=1 "

谢谢。

日志文件

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    proxy_read_timeout 600; 

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index index.php;
        fastcgi_read_timeout 600;
            #The above line has been added and below line has been commented to use the php code.
            #index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #   proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        ########## Code added during Configuration By Anthony ################
        location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  c:/nginx/html/$fastcgi_script_name;
        include        fastcgi_params;
        }
        ######################################################################
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}
Run Code Online (Sandbox Code Playgroud)

小智 1

就我而言,我使用 TCP 端口而不是套接字在 FreeBSD Jail( Nginx 1.6.2、PHP/5.6.6 )内运行服务器。问题解决了更改我的两个设置

php-fpm.conf

文件:

;listen.allowed_clients = 127.0.0.1 # comment out to listen to any
listen = 9000 # No IP-Address
Run Code Online (Sandbox Code Playgroud)

有效。