Nginx中的stub_status模塊主要用於查看Nginx的一些狀態信息.
本模塊默認是不會編譯進Nginx的,如果你要使用該模塊,則要在編譯安裝Nginx時指定:
# ./configure --with-http_stub_status_module
# make
# make install
安裝完成後,修改conf/nginx.conf
location /status {
root html;
index index.html index.htm;
stub_status on;
}
重新加載nginx
# ./nginx -s reload
注意這裏配置的是/status,所以監控頁面訪問http://localhost/status
頁面顯示如
Active connections: 1002
server accepts handled requests
29977 29977 30115
Reading: 19 Writing: 983 Waiting: 0