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
更换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的更多相关文章
- 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( ...
- 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 ...
- nginx 的 upstream timed out 问题
nginx 作为负载服务,表现为网站访问很慢,有些文件或页面要等待到60s才会返回,我注意到60s就是超时时间,但是超时后返回状态是正常值200,网站可以正常打开,就是会一直等待到超时才打开,而且问题 ...
- 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 ...
- 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 ...
- nginx 报错 upstream timed out (110: Connection timed out)解决方案
nginx 作PHP的web接口服务器. 在线上发现时不时经常崩溃.504,导致接口访问无响应回复. 查看日志: [error] 11618#0: *324911 upstream timed out ...
- 压测 502 日志报错 upstream timed out (110: Connection timed out)
环境介绍 服务器:centos6.5服务:nginx proxy 问题描述: 压测 开发同事 的开发环境项目没事,但是 线上机器 命中%50 ,大量502 php的某些页面打不开,页面提示gatewa ...
- nginx 报错 upstream timed out (110: Connection timed out)解决方案【转】
转自 nginx 报错 upstream timed out (110: Connection timed out)解决方案 - 为程序员服务http://outofmemory.cn/code-sn ...
- upstream timed out (110: Connection timed out) while reading response header from upstream, client:
遇到的问题 之前没配置下面这段,访问时候偶尔会出现 504 gateway timeout,由于偶尔出现,所以不太好排查 proxy_connect_timeout 300s;proxy_read_t ...
随机推荐
- C/C++中手动获取调用堆栈【转】
转自:http://blog.csdn.net/kevinlynx/article/details/39269507 版权声明:本文为博主原创文章,未经博主允许不得转载. 当我们的程序core掉之后, ...
- Linux-进程间通信(三): 共享内存
1. 共享内存: 共享内存方式可以在多个进程直接共享数据,因为其直接使用内存,不要多余的拷贝,是速度最快的IPC方式: 共享内存有两种实现方式,使用mmap和shm方式,如下图: (1) mmap方式 ...
- android 图片透明
在ImageButton中载入图片后,图片周围会存在一圈白边,会影响到美观,其实解决这个问题有两种方法 一种方法是将ImageButton的背景改为所需要的图片.如:android:backgroun ...
- ie6下面不支持!important的处理方法
例子: #box { color:red !important; color:blue; } 这个例子应该是大家经常见到的important的用法了,在IE6环境下,这行字是蓝色 ...
- 面试题之实现系统函数系列一:实现memmove函数
编译环境 本系列文章所提供的算法均在以下环境下编译通过. [算法编译环境]Federa 8,linux 2.6.35.6-45.fc14.i686 [处理器] Intel(R) Core(TM)2 Q ...
- ReentrantLock 分析
带着疑问去分析 ReentrantLock是如何实现锁管理的. ReentrantLock是如何实现重入的. ReentrantLock是如何实现公平锁与非公平锁. ReentantLock的公平锁为 ...
- Thinking in java基础之集合框架(转载)
集合简介(容器)把具有相同性质的一类东西,汇聚成一个整体,就可以称为集合,例如这里有20个苹果,我们把每一个苹果当成一个东西(一个对象),然后我们借用袋子把这20个苹果装起来,而这个袋子就是集合(也叫 ...
- Javascript备忘录-枚举一个对象的所有属
for...in 循环 var obj = { age: 18, fname: "Rand ", lname: "McKinnon" }; function s ...
- 深入理解String.intern()方法
首先进入intern()的源码中, 首先说一点:1.7后的JVM为String在方法区中开辟了一个字符串常量池,如果一个String()不是new()出来的,都将在常量池中拿字符. 注释翻译过来就是, ...
- 编译python可以调用的dll
如果经过stdcall声明的方法,如果不是用def文件声明的导出函数或者extern “C” 声明的话,编译器会对函数名进行修改;在编译加上extern C:这样就OK了:另外可以在PYTHON代码里 ...