nginx连接超时和客户端closures连接问题

我有这个nginx服务器在AWS上运行,直到最近,当几个用户开始抱怨网站没有打开,直到他们做了10次尝试访问它。

我从来没有能够从我这边复制这个问题。 我使用谷歌的DNS即8.8.8.8&当我改变了一个用户相同,该网站工作正常。 现在这可能是原因,或者这也可能只是一个巧合。

我在错误日志中find了这个 –

2014/05/29 13:46:15 [info] 6940#0: *150649 client timed out (110: Connection timed out) while waiting for request, client: xx.xxx.xxx.xx, server: 0.0.0.0:80 2014/05/29 13:46:20 [info] 6940#0: *150670 client closed connection while waiting for request, client: xx.xxx.xxx.xx, server: 0.0.0.0:80 2014/05/29 13:46:20 [info] 6940#0: *150653 client closed connection while waiting for request, client: xx.xxx.xxx.xx, server: 0.0.0.0:80 2014/05/29 13:46:20 [info] 6940#0: *150652 client closed connection while waiting for request, client: xx.xxx.xxx.xx, server: 0.0.0.0:80 

甚至有些地方

 2014/05/29 13:46:53 [info] 6940#0: *150665 client closed connection while waiting for request, client: xx.xxx.xxx.xx, server: 0.0.0.0:80 2014/05/29 13:46:53 [info] 6940#0: *150660 client xx.xxx.xxx.xx closed keepalive connection 

注 – 已将xx.xxx.xxx.xx放置在客户IP上

这里是nginxconfiguration –

 server { listen 80; server_name somedomain.com www.somedomain.com; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; root /var/www/somedomain/current/app/webroot; index index.php index.html index.htm; ... couple of location rules ... } 

我真的很感激任何帮助。

谢谢

    根据您从Nginx提供的日志,似乎您的服务器和用户之间的连接不稳定或缓慢。 请尝试从您的服务器traceroute到您的客户端IP地址或他/她的网关。 另外,请长时间ping您的客户端IP地址,以查看丢包率和响应时间。 MTU可能是这个问题的另一个来源。 testing您是否可以通过MTU = 1500(Mac: ping -D -s 1472 xx.xx.xx.xx )访问您的客户端。

    顺便说一句:如果你的服务器或客户端居住在中国,这个问题通常不是你的错。 已知GFW随机丢弃边界之间的数据包,以故意使国际连接质量变差。

    正如在评论中推测的那样,这可能是用户错误,他们正在closures连接(无论是否有意)。 尝试可靠地重现问题。 排除在别处发生,如果只是这个位置,他们将需要排除故障。 尝试从不同的浏览器/计算机,然后testingnetworking的可靠性。

    这些日志条目看起来类似于使用OpenVAS等工具扫描服务器时显示的条目。 这些工具连接不好,运行缓慢或操作不当; nginx只是报告说有些连接不好玩。 如果所有stream量来自同一个来源,而且速度很快,并且在访问日志中没有其他合法的请求,那么这可能只是一种机器人扫描程序。

    这些扫描程序也可能会使您的应用程序处于负载状态,从而导致其他合法通信速度变慢。