conf配置如下
security_ui 下是静态页面,访问没问题
http://safeguard 对应的是后台程序
譬如访问 http://localhost:8090/api/index?msisdn=bc65670205bff064f878d61afa2e98b5&channel=null
访问的时候时不时pending,有时很快,有时很久才得到响应
怎么回事?
ps:不用8090端口进行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"
感觉与nginx配置关系不大。检查一下后台代码。