关于Nginx 状态监控
我现在想装状态模块stub_status,网页上提示:在编译Nginx的时候,需要添加以下参数:
--with-http_stub_status_module
请问具体是怎样编译?
在网上发现一款“监控X”(为了避免广告嫌疑,省略一字),可以监控服务器的状态。所以,想试试看。
有没有哪位高手使用过的?不知道耗不耗资源?
回复 1# 的帖子
此模块默认已编译。 军哥,我用IE打开:http://www.aad.com/status或:http://www.aad.com/nginx-status或:http://www.aad.com/server-status都提示:404 Not Found在上面的监控X里,则提示:您填写的URL不是正确的Nginx状态页面地址。能不能帮我看看原因? 我查了下/usr/local/nginx/conf 下面的nginx.conf文件,里面有这么一段location /status {
stub_status on;
access_log off;
}
但是,用上面的地址都打不开。
回复 3# 的帖子
默认的状态信息是 http://域名/nginx_status如果重新加的需要,重启nginx才会生效。 我的是重启也是404..压根就没生成那个目录......
是不是我做了空主机头有关系? userwww www;
worker_processes 4;
worker_cpu_affinity 0001 0010 0100 1000;
error_log/home/wwwlogs/nginx_error.logcrit;
pid /usr/local/nginx/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
}
http
{
include mime.types;
default_typeapplication/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 8m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
#limit_zonecrawler$binary_remote_addr10m;
server
{
listen 80 default;
return 500;
location ~ .*\.(php|php5)?$
{
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location /status {
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location /idc/nginx-status {
stub_status on;
access_logoff;
}
log_formataccess'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log/home/wwwlogs/access.logaccess;
}
include vhost/*.conf;
} 测试成功 这样就可以了!
http://173.212.254.126/status
http://cs.henyoo.com/status
页:
[1]