更换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. 前端—css

    css css概述 CSS是Cascading Style Sheets的简称,中文称为层叠样式表,用来控制网页数据的表现,可以使网页的表现与数据内容分离. 一.css的四种引入方式: 1.行内式   ...

  2. Vue组件-组件的事件

    自定义事件 通过prop属性,父组件可以向子组件传递数据,而子组件的自定义事件就是用来将内部的数据报告给父组件的. <div id="app3"> <my-com ...

  3. C++学习之路(五):复制构造函数与赋值运算符重载

    之前没有细想过两者的区别,今天对此进行简要记录,后续完善补充. 复制构造函数是在类对象被创建时调用的,但是赋值运算符是被已经存在的对象调用完成赋值操作. 复制构造函数只在对象实例化时才被调用,即在复制 ...

  4. 设计模式之笔记--桥接模式(Bridge)

    桥接模式(Bridge) 定义 桥接模式(Bridge),将抽象部分与它的实现部分分离,使它们都可以独立地变化. 类图 描述 Abstraction:定义抽象部分的接口,通常在这个接口里面要维护一个实 ...

  5. 微信小程序使用canvas绘制图片的注意事项

    1.单位换算问题,canvas的尺寸单位是px,所以单位需要做个换算,可以通过wx.getSystemInfo获取屏幕宽高(单位是px),微信小程序无论什么机型,屏幕宽度都是750rpx,因此可以做个 ...

  6. SSH认证原理和批量分发管理

    SSH密码认证原理 几点说明: 1.服务端/etc/ssh目录下有三对公钥私钥: [root@m01 ssh]# ls moduli ssh_config sshd_config ssh_host_d ...

  7. linux 设置开机启动项两种方式

    原文链接:http://blog.csdn.net/karchar/article/details/52489572 有时候我们需要Linux系统在开机的时候自动加载某些脚本或系统服务. 在解问题之前 ...

  8. Leetcode 之Same Tree(48)

    用递归比较简单,这里用迭代的方式实现.注意什么时候返回true,什么时候返回false. bool isSameTree(TreeNode *p, TreeNode *q) { stack<Tr ...

  9. .net/c#常用框架/中间件简介(不定时更新)

    任务调度 Quartz.NET:Quartz.NET是一个开源的作业调度框架,非常适合在平时的工作中,定时轮询数据库同步,定时邮件通知,定时处理数据等. Quartz.NET允 许开发人员根据时间间隔 ...

  10. [水煮 ASP.NET Web API2 方法论](1-2)在 WebForm 应用程序中添加 ASP.NET Web API

    问题 怎么样将 Asp.Net Web Api 加入到 Asp.Net Web From 应用程序中 解决方案 在 Visual Studio 2013 中,创建新的 Web From,可以直接在&q ...