鍍金池/ 問答/Linux  網(wǎng)絡(luò)營(yíng)銷/ windows下nginx配置后,http訪問pending怎么回事?

windows下nginx配置后,http訪問pending怎么回事?

conf配置如下
security_ui 下是靜態(tài)頁面,訪問沒問題
http://safeguard 對(duì)應(yīng)的是后臺(tái)程序
譬如訪問 http://localhost:8090/api/index?msisdn=bc65670205bff064f878d61afa2e98b5&channel=null
訪問的時(shí)候時(shí)不時(shí)pending,有時(shí)很快,有時(shí)很久才得到響應(yīng)
怎么回事?
ps:不用8090端口進(jìn)行nginx路由,直接用8080就沒問題

upstream safeguard{
   server localhost:8080;
   #server 192.168.194.72:8013;
   #ip_hash;
}

server {
    listen       8090;
    server_name  localhost;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        root   html;
        proxy_pass http://safeguard;
        index  index.html index.htm;
    }


    location /security_ui {
        root   D:\svn\safeGuard;
        index  index.html index.htm;
    }
    。。。
    

nginx log日志:

2018/03/27 19:25:04 [error] 11868#9296: *192 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 connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /api/index/pIndex?msisdn=bc65670205bff064f878d61afa2e98b5&channel=null HTTP/1.1", upstream: "http://[::1]:8080/api/index/pIndex?msisdn=bc65670205bff064f878d61afa2e98b5&channel=null", host: "localhost:8090", referrer: "http://localhost:8090/security_ui/html/index.html?msisdn=bc65670205bff064f878d61afa2e98b5&channel=null"
2018/03/28 10:48:02 [error] 4092#212: *7 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 connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /api/index/pIndex?msisdn=bc65670205bff064f878d61afa2e98b5&channel=null HTTP/1.1", upstream: "http://[::1]:8080/api/index/pIndex?msisdn=bc65670205bff064f878d61afa2e98b5&channel=null", host: "localhost:8090", referrer: "http://localhost:8090/security_ui/html/index.html?msisdn=bc65670205bff064f878d61afa2e98b5&channel=null"
回答
編輯回答
舊酒館

pengding狀態(tài)是說后端接口還沒響應(yīng),在等待,這個(gè)不應(yīng)該是前端的鍋

2017年5月2日 18:50
編輯回答
病癮

感覺與nginx配置關(guān)系不大。檢查一下后臺(tái)代碼。

2018年1月31日 09:19
編輯回答
小曖昧

遇到類似的問題,不走ningx直接訪問都是100ms左右,走nginx有時(shí)候直接達(dá)到proxy_connect_timeout默認(rèn)設(shè)置的60s之后才返回。
圖片描述
圖片描述
找不到原因,臨時(shí)解決辦法是把超時(shí)時(shí)間設(shè)置為3s。

proxy_connect_timeout 3s;
2017年3月18日 18:49
<div id="s7vsi"><form id="s7vsi"><div id="s7vsi"></div></form></div>