nginx负载均衡页面不定时出现520错误
阿里云的机器,以前偶尔会出现502,最近突然频繁了,每天四五次,每次都重启其中一个机器的memcache和网站程序才行,
nginx的err日志:
2015/12/02 10:51:34 [error] 1572#0: *1051463 no live upstreams while connecting to upstream, client: xx.xxx.xxx.xx, server: localhost, request: "HEAD / HTTP/1.0", upstream: "http://app/test/testIndex.action"
2015/12/02 10:51:34 [error] 1572#0: *1051464 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xxx.xxx.xxx, server: localhost, request: "HEAD / HTTP/1.0", upstream: "http://xx.xxx.xxx.xx:8080/test/testIndex.action"
2015/12/02 10:51:34 [error] 1572#0: *1051464 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xxx.xxx.xxx, server: localhost, request: "HEAD / HTTP/1.0", upstream: "http://127.0.0.1:8080/test/testIndex.action"
java写的网站,有两台服务器,linux系统,resin 4.0做web容器,有时登录网站会提示502,这期间直接通过IP访问或者IP加端口都不能打开页面,但是在后台看应用日志发现网站程序还在正常跑,对nginx和resin都不怎么熟,请教下出现这种情况大概问题是在哪里,nginx的问题还是regin的问题。
程序还用了Memcached,每次出现这种情况我重启一台机器的memcache和应用就正常了,只是最近突然频繁了。
页面提示信息:
502 Bad Gateway
The proxy server received an invalid response from an upstream server. Sorry for the inconvenience.
Please report this message and include the following information to us.
Thank you very much!
特疑惑为什么会不定时的出现502,如果是配置内容问题应该是一直出现错误,如果是内存什么的问题,有时候刚重启完马上就出现这种情况了。想不清问题会在哪。