【发布时间】:2014-07-24 02:39:57
【问题描述】:
我正在尝试向 localhost 发出状态请求,并在 error.log 文件中获取错误消息。你知道,如何解决这个问题? 或者它可能只是一个信息消息,它总是带有“no keepalive”数据包。
/usr/bin/curl --no-keepalive -s -m 3 http://127.0.0.1/server-status
/tmp/error.log
2014/07/24 06:03:23 [info] 18038#0: *198319 client 127.0.0.1 closed keepalive connection
2014/07/24 06:04:22 [info] 18038#0: *198398 client 127.0.0.1 closed keepalive connection
/tmp/access.log
127.0.0.1 - - [24/Jul/2014:06:03:23 +0400] "GET /server-status HTTP/1.1" 200 110 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2"
127.0.0.1 - - [24/Jul/2014:06:04:22 +0400] "GET /server-status HTTP/1.1" 200 110 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2"
/etc/nginx/nginx.conf
error_log /var/log/nginx/error.log warn;
http {
client_body_timeout 10;
client_header_timeout 10;
keepalive_timeout 5 5;
send_timeout 10;
include /etc/nginx/sites-enabled/*;
}
/etc/nginx/sites-enabled/localhost
server {
listen localhost;
server_name nginx_status.localhost;
access_log /tmp/access.log;
error_log /tmp/error.log info;
location /server-status {
stub_status on;
allow 127.0.0.1;
deny all;
}
}
【问题讨论】:
-
写成“关闭的keepalive连接”。所以,这意味着,这种连接是“keepalive”的。我不想要keepalive连接!