测试了一下nginx ajp模块,发现可能有如下问题(有些问题并不是这个模块带来的):
1、潜在bug,ngx_http_ajp.c:359行%s输出格式,但r->method不是字符串类型,而是ngx_uint_t类型,所以有可能会导致进程崩溃的情况发生
357 if ((method = sc_for_req_method_by_id(r)) == UNKNOWN_METHOD) {
358 ngx_log_error(NGX_LOG_ERR, log, 0,
359 "ajp_marshal_into_msgb - No such method %s", r->method);
360 return NGX_ERROR;
361 }
2、我用jackrabbit开源项目测试了一下,发现访问populate.jsp的时候,存在着一个小问题
我们先用apache测试一下(走ajp协议)
apache反应如下:
00:00:02.293 150.543 1649 151 POST 200 text/html :8022/jackrabbit-webapp-2.2.5/populate.jsp
从150s终于显示页面,开始显示进度条
从wireshark可以看出,不管是啥,ajp协议都是先传递信息给tomcat,之后tomcat传递给apache,中间没有交叉
00:20:25.676 150.803 1649 151 POST 200 text/html :8022/jackrabbit-webapp-2.2.5/populate.jsp
...
7 0.001490 61.135.250.217 61.135.255.86 TCP oa-system > hpvmmdata [ACK] Seq=1 Ack=1650 Win=11680 Len=0
8 150.673242 61.135.250.217 61.135.255.86 TCP oa-system > hpvmmdata [ACK] Seq=1 Ack=1650 Win=11680 Len=1460[Packet size limited during capture]
...
16 150.677218 61.135.255.86 61.135.250.217 TCP hpvmmdata > oa-system [ACK] Seq=1650 Ack=8246 Win=65535 Len=0
17 387.459848 61.135.250.217 61.135.255.86 TCP oa-system > hpvmmdata [ACK] Seq=8246 Ack=1650 Win=11680 Len=1460[Packet size limited during capture]
....
26 454.233836 61.135.250.217 61.135.255.86 TCP oa-system > hpvmmdata [ACK] Seq=16270 Ack=1650 Win=11680 Len=1460[Packet size limited during capture]
...
35 510.252836 61.135.250.217 61.135.255.86 TCP oa-system > hpvmmdata [ACK] Seq=24292 Ack=1650 Win=11680 Len=1460[Packet size limited during capture]
...
44 525.567410 61.135.250.217 61.135.255.86 TCP oa-system > hpvmmdata [ACK] Seq=32329 Ack=1650 Win=11680 Len=1460[Packet size limited during capture]
...
53 527.899546 61.135.250.217 61.135.255.86 TCP oa-system > hpvmmdata [ACK] Seq=40399 Ack=1650 Win=11680 Len=1460[Packet size limited during capture]
...
62 556.146207 61.135.250.217 61.135.255.86 TCP oa-system > hpvmmdata [ACK] Seq=48461 Ack=1650 Win=11680 Len=1460[Packet size limited during capture]
...
71 572.829348 61.135.250.217 61.135.255.86 TCP oa-system > hpvmmdata [ACK] Seq=56498 Ack=1650 Win=11680 Len=1460[Packet size limited during capture]
...
79 640.164545 61.135.250.217 61.135.255.86 TCP oa-system > hpvmmdata [ACK] Seq=64551 Ack=1650 Win=11680 Len=1460[Packet size limited during capture]
...
87 708.108726 61.135.250.217 61.135.255.86 TCP oa-system > hpvmmdata [ACK] Seq=72627 Ack=1650 Win=11680 Len=1460[Packet size limited during capture]
...
96 796.132990 61.135.250.217 61.135.255.86 TCP oa-system > hpvmmdata [ACK] Seq=80643 Ack=1650 Win=11680 Len=1460[Packet size limited during capture]
nginx访问tomcat (ajp):