10060: A connection attempt fail
2021-03-27 本文已影响0人
我爱福尔摩斯呀
2021/03/27 13:39:52 [error] 8348#12812: *31 connect() failed (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 connecting to upstream, client: 117.176.126.128, server: 192.168.15.42, request: "POST /api/auth/user/token HTTP/1.1", upstream: "http://221.237.186.26:8763/api/auth/user/token", host: "221.237.186.26:8104", referrer: "http://221.237.186.26:8104/login"
2021/03/27 13:40:11 [error] 8348#12812: *32 connect() failed (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 connecting to upstream, client: 117.176.126.128, server: 192.168.15.42, request: "GET /api/auth/user/tokenByDingTalk?code=6629ddea6c3e3bf7925044014c524675&state=bind HTTP/1.1", upstream: "http://221.237.186.26:8763/api/auth/user/tokenByDingTalk?code=6629ddea6c3e3bf7925044014c524675&state=bind", host: "221.237.186.26:8104", referrer: "http://221.237.186.26:8104/login"
nginx.conf配置
server {
listen 8182;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
location /upload/ {
alias d:/upload/;
}
}
server{
listen 8104;
server_name 192.168.15.41;
fastcgi_buffers 8 256k;
send_timeout 60;
location / {
root gmc-client;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://localhost:8763/api/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
#扫码登陆
location /connect {
proxy_pass https://oapi.dingtalk.com/connect;
proxy_set_header Host oapi.dingtalk.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#imap
location /iMap/iMapServer/{
proxy_pass http://www.scgis.net.cn/iMap/iMapServer/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}
解决方法
将localhost改为127.0.0.1