nginx tomcat 访问问题

hechangsheng18 2013-12-29 11:48:58
各位大侠,小弟遇到一个问题(nginx1.5.8+tomcat6+jdk6+windows2008,服务器在美国):
这周末前,国内(深圳)、美国等地客户客户机都能正常访问产品列表(列表数据通过ajax,调用app中的action返回)。但就在这两天深圳地区这边访问产品列表时,需要大概10分钟才能加载出来。而在福州和美国的朋友测试了下,都能正常的加载产品列表。我在深圳这边的网络环境正常,上网速度都很快,是光纤。请大侠们帮忙看看,分析下。不知是否与电信网络有关。
下面是主要配置:
nginx.conf
upstream location {
ip_hash;
server localhost:18081 weight=5;
server localhost:18082 weight=5;
}
location ~ \.(jsp|action)$ {
proxy_pass http://location;
#include proxy.conf;
}
location ~ \/(j_acegi_security_check)$ {
proxy_pass http://location;
#include proxy.conf;
}
proxy.conf
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;

NGINX日志片段
error.log

2013/12/29 23:18:57 [info] 5436#4544: *304 client closed connection while waiting for request, client: 127.0.0.1, server: 0.0.0.0:80
2013/12/29 23:19:15 [info] 5436#4544: *228 client 183.16.199.105 closed keepalive connection (10054: An existing connection was forcibly closed by the remote host)
2013/12/29 23:19:25 [info] 5436#4544: *266 client 183.16.199.105 closed keepalive connection (10054: An existing connection was forcibly closed by the remote host)
2013/12/29 23:21:10 [info] 5436#4544: *316 client 66.249.73.119 closed keepalive connection
2013/12/29 23:23:31 [info] 5436#4544: *317 client 157.55.32.184 closed keepalive connection
2013/12/29 23:53:56 [error] 5436#4544: *319 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: 183.16.199.105, server: localhost, request: "POST /search/loadGoodsVoForIdx.action HTTP/1.1", upstream: "http://[::1]:18082/search/loadGoodsVoForIdx.action", host: "www.powermuster.com", referrer: "http://www.powermuster.com/shop/clearance-sale.html"
...全文
695 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
铁铲 2016-07-06
  • 打赏
  • 举报
回复
仁兄的问题是否已经解决?
letusdoitslowly 2015-04-28
  • 打赏
  • 举报
回复
仁兄的问题是否已经解决?
hechangsheng18 2013-12-31
  • 打赏
  • 举报
回复
自己顶一下吧。 这两天我都观察了下,每天晚上下班后回到家。用家里的网络,访问www.powermuster.com,nginx分发到后端服务器,再调用action,返回产品列表,每次大概都要10分钟左右;不用nginx代理,直接访问后端服务器,速度比较正常,能正常加载产品列表。

5,655

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧