### StubStatus模塊
這個模塊能夠獲取Nginx自上次啟動以來的工作狀態
此模塊非核心模塊,需要在編譯的時候手動添加編譯參數 `--with-http_stub_status_module`
__配置說明__
~~~
location /nginx_status {
: # copied from http://blog.kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/
: stub_status on;
: access_log off;
: allow SOME.IP.ADD.RESS;
: deny all;
}
~~~
### 指令
- [#stub_status stub_status]
### stub_status
**語法:***stub_status* on
**默認值:***None*
**作用域:***location*
創建一個 location 區域啟用 stub_status
"stub status" 模塊返回的狀態信息跟 [mathopd's](http://www.mathopd.org/ "http://www.mathopd.org/") 的狀態信息很相似. 返回的狀態信息如下:
~~~
Active connections: 291
server accepts handled requests
: 16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
~~~
`active connections` -- 對后端發起的活動連接數
`server accepts handled requests` -- nginx 總共處理了 16630948 個連接, 成功創建 16630948 次握手 (證明中間沒有失敗的), 總共處理了 31070465 個請求 (平均每次握手處理了 1.8個數據請求)
`reading` -- nginx 讀取到客戶端的Header信息數
`writing` -- nginx 返回給客戶端的Header信息數
`waiting` -- 開啟 keep-alive 的情況下,這個值等于 `active - (reading + writing)`,意思就是Nginx說已經處理完正在等候下一次請求指令的駐留連接
### Examples
[http://blog.kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/](http://blog.kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/ "http://blog.kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/")
[http://dev.2xlp.com/svn/nginx_config/trunk/conf/_rrd/__README__.txt](http://dev.2xlp.com/svn/nginx_config/trunk/conf/_rrd/__README__.txt "http://dev.2xlp.com/svn/nginx_config/trunk/conf/_rrd/__README__.txt")
- 主要文檔
- Nginx功能概述
- 為什么選擇Nginx
- Nginx安裝
- 運行和控制Nginx
- 配置符號參考
- 優化 Nginx
- 常見問題(FAQ)
- 調試 nginx
- 核心模塊
- Nginx主模塊
- Nginx事件模塊
- 基本模塊
- http核心模塊
- HttpIndex模塊
- HttpAccess模塊
- HttpAuthBasic模塊
- HttpAutoindex模塊
- Browser模塊
- Charset模塊
- HttpEmptyGif模塊
- HttpFcgi模塊
- Geo模塊
- HttpGzip模塊
- HttpHeaders模塊
- HttpIndex模塊
- HttpReferer模塊
- HttpLimit zone
- HttpLimitReqest模塊
- HttpLog模塊
- map
- Memcached
- HttpProxy模塊
- HttpRewrite模塊
- HttpSSI模塊
- HttpUserId
- 其他模塊
- Addition模塊
- EmbeddedPerl
- flv
- HttpGzipStatic
- RandomIndex
- HttpGeoIP
- HttpRealIp
- HttpSSL
- StubStatus模塊
- HttpSubstitution
- HttpDav模塊
- GooglePerftools
- HttpXSLT
- HttpSecureLink
- HttpImageFilter
- mail模塊
- MailCore
- MailAuth
- MailProxy
- MailSSL
- 安裝
- nginx在windows上的安裝
- nginx在freebsd上的安裝
- nginx在ubuntu上的安裝
- nginx在fedora上的安裝
- nginx php-fpm安裝配置
- 配置示例和方法
- 完整例子
- 完整例子2
- 虛擬主機
- 負載均衡
- nginx防盜鏈
- HWLoadbalancerCheckErrors