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 ...
随机推荐
- js删除数组中重复的元素
1.方法一 将数组逐个搬到另一个数组中,当遇到重复元素时,不移动,若元素不重复则移动到新数组中 function unique(arr){ var len = arr.length; var resu ...
- python中的argparse模块
argparse干什么用的? 答:参数设置,比如python demo.py -h 诸如此类的. 开始学习这个模块: parser = argparse.ArgumentParser() #使用这个模 ...
- linux中断线程化分析【转】
转自:http://blog.csdn.net/qq405180763/article/details/24120895 版权声明:本文为博主原创文章,未经博主允许不得转载. 最近在为3.8版本的Li ...
- Laravel 5.2 四、.env 文件与模型操作
一..env文件 .env 文件是应用的环境配置文件,在配置应用参数.数据库连接.缓存处理时都会使用这个文件. // 应用相关参数 APP_ENV=local APP_DEBUG=true //应用调 ...
- 关于might_sleep的一点说明【转】
转自:http://blog.csdn.net/chen_chuang_/article/details/48462575 这个函数我在看代码时基本上是直接忽略的(因为我知道它实际上不干什么事),不过 ...
- centos 快捷键
centos 快捷键大全 时间:2013-02-23 14:54来源:blog.csdn.net 举报 点击:225次 新手通常会不太习惯GNOME或KDE的界面操作,不过还好,LINUX的快捷键大多 ...
- node.js3
第一部分:express(MVC) 1.下载express npm install express --save 2.引入express require('express') 中间件 body-par ...
- CSS中cursor属性给标签加上小手形状
HTML/CSS 2012-08-10 CSS,标签 我们发现a标签在网页中有一个值得注意的地方,即鼠标移到a标签上光标会变成一只小手的图标,移出a标签后又恢复为默认箭头. 如今,JS在网页中的功能越 ...
- django “如何”系列5:如何编写自定义存储系统
如果你需要提供一个自定义的文件存储-一个常见的例子便是在远程系统上存储文件-你可以通过定义一个自己的存储类来做这件事情,你将通过一下步骤: 你自定义的存储系统一定是django.core.files. ...
- Integer to Roman——相当于查表法
Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 t ...