更换Apache扑向Nginx,刚搭建完WNMP,nginx能访问php页面 但是访问现有开发项目报错

 [error] 4112#3724: *9 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond
after a period of time, or established connection failed because connected host has failed to respond) while reading response header
from upstream, client: 127.0.0.1, server: localhost, request: "GET /right/backend/web/index.php?r=api/get-products HTTP/1.1",
upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1"

通过探寻 找到原因 当前使用的是项目A,但是A调用了项目B(权限系统) 但是配置的Nginx时只固定了一个9000端口 A占用后;B就无法访问

解决方案:

1.修改nginx.conf 添加端口(红色部分)

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; gzip on; upstream fastcgi_backend {
server 127.0.0.1:9001;
server 127.0.0.1:9002;
server 127.0.0.1:9003;
server 127.0.0.1:9004;
server 127.0.0.1:9005;
server 127.0.0.1:9006;
server 127.0.0.1:9007;
}
server {
listen 80;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root D:/WNMP/nginx-1.10.3/html;
index index.html index.htm index.php;
autoindex on;
} #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 D:/WNMP/nginx-1.10.3/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
#
location ~ \.php$ {
# root D:/WNMP/nginx-1.10.3/html;
fastcgi_pass fastcgi_backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME D:/WNMP/nginx-1.10.3/html$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;
#}
}

2.如果使用快捷脚本启动WNMP,脚本修改(可以将php nginx加入环境变量使用相对路径,我用的绝对路径哈,因为项目多,方便应用不同php版本)

@echo off
start /B D:/WNMP/php7/php-cgi.exe -b 127.0.0.1:9001 &
start /B D:/WNMP/php7/php-cgi.exe -b 127.0.0.1:9002 &
start /B D:/WNMP/php7/php-cgi.exe -b 127.0.0.1:9003 &
start /B D:/WNMP/php7/php-cgi.exe -b 127.0.0.1:9004 &
start /B D:/WNMP/php7/php-cgi.exe -b 127.0.0.1:9005 &
start /B D:/WNMP/php7/php-cgi.exe -b 127.0.0.1:9006 &
start /B D:/WNMP/php7/php-cgi.exe -b 127.0.0.1:9007 &
start /B D:/WNMP/nginx/nginx.exe

BUG:upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected的更多相关文章

  1. python下载时报错 Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time

    def downloadXml(isExists,filedir,filename): if not isExists: os.mkdir(filedir) local = os.path.join( ...

  2. upstream timed out (10060: A connection attempt failed because the connected party did not properly respond

    openresty 错误日志报错内容: // :: [error] #: * upstream timed : A connection attempt failed because the conn ...

  3. nginx 的 upstream timed out 问题

    nginx 作为负载服务,表现为网站访问很慢,有些文件或页面要等待到60s才会返回,我注意到60s就是超时时间,但是超时后返回状态是正常值200,网站可以正常打开,就是会一直等待到超时才打开,而且问题 ...

  4. VScode 1.13 gocode提示dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected..

    在将VScode升级至 1.13后让升级gocode,在升级时报出如下错误 D:\go_work\src>go get -u -v github.com/mdempsky/gocode gith ...

  5. vs code解决golang开发环境问题 dial tcp 216.239.37.1:443: connectex: A connection attempt failed

    安装插件是出现 如下错误提示, https fetch failed: Get https://golang.org/x/tools/cmd/gorename?go-get=1: dial tcp 2 ...

  6. nginx 报错 upstream timed out (110: Connection timed out)解决方案

    nginx 作PHP的web接口服务器. 在线上发现时不时经常崩溃.504,导致接口访问无响应回复. 查看日志: [error] 11618#0: *324911 upstream timed out ...

  7. 压测 502 日志报错 upstream timed out (110: Connection timed out)

    环境介绍 服务器:centos6.5服务:nginx proxy 问题描述: 压测 开发同事 的开发环境项目没事,但是 线上机器 命中%50 ,大量502 php的某些页面打不开,页面提示gatewa ...

  8. nginx 报错 upstream timed out (110: Connection timed out)解决方案【转】

    转自 nginx 报错 upstream timed out (110: Connection timed out)解决方案 - 为程序员服务http://outofmemory.cn/code-sn ...

  9. upstream timed out (110: Connection timed out) while reading response header from upstream, client:

    遇到的问题 之前没配置下面这段,访问时候偶尔会出现 504 gateway timeout,由于偶尔出现,所以不太好排查 proxy_connect_timeout 300s;proxy_read_t ...

随机推荐

  1. java封装示例代码

    package com.imooc; public class Telphone { private float screen; private float cpu; private float me ...

  2. tcp 在调用connect失败后要不要重新socket

    tcp 在调用connect失败后要不要重新socket http://blog.csdn.net/occupy8/article/details/48253251

  3. MNIST数据集转化为二维图片

    #coding: utf-8 from tensorflow.examples.tutorials.mnist import input_data import scipy.misc import o ...

  4. windows系统安装mysql压缩zip版

    1.下载 打开官网:https://www.mysql.com 进入DOWNLOADS--->Community--->MySQL Community Server,选择系统对应的版本点击 ...

  5. hdu5798

    官方题解: 考虑去掉abs符号,发现只有相邻两个数的最高位被影响了才会影响abs的符号,所以可以按照最高位不一样的位置分类,之后考虑朴素枚举x从0到2^20,每次的复杂度是O(400),无法通过,考虑 ...

  6. string char * const char *之间的互相转换

    string  ->   const char * 用str的c_str()方法或者data()方法均可,这个两个方法返回值为cong char * string str = "hel ...

  7. websocket小荔枝

    关于websocket原理和好处请参考百度,这里只是代码. var ws = new WebSocket('ws://echo.websocket.org/'); ws.onopen = functi ...

  8. 启动Tomcat报错 “A child container failed during start”

    严重: A child container failed during startjava.util.concurrent.ExecutionException: org.apache.catalin ...

  9. Mybatis框架-1

    1.Mybatis框架: Mybatis是一个半自动的对象关系映射(ORM),实现结果集的自动封装,sql写到配置文件中: Mybatis使用的是DTD约束. 2.Mybatis模块调用: 3.Sql ...

  10. php 通过类名获取类的文件地址

    $reflector = new ReflectionClass("Child"); $fn = $reflector->getFileName(); return dirn ...