您好,登錄后才能下訂單哦!
本篇內(nèi)容介紹了“nginx如何添加http_stub_status_module模塊”的有關(guān)知識(shí),在實(shí)際案例的操作過(guò)程中,不少人都會(huì)遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
編譯選項(xiàng) | 作用 |
---|---|
–with-http_stub_status_module | Nginx的客戶端狀態(tài) |
./nginx -V # 如果沒(méi)有我們需要的模塊,例如本次試驗(yàn)添加的 –with-http_stub_status_module ,那么則需要重新編譯安裝一下
configure 文件是在安裝包目錄下的文件,具體可參考 centos 7 安裝 nginx
./configure --prefix=/usr/local/nginx --with-http_realip_module --with-http_ssl_module --with-pcre --with-stream --with-http_stub_status_module
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
make # 這里是需要 make 編譯,不用 make install
# 找到 nginx 安裝包目錄 /root/nginx-1.10.1/objs ,將 nginx 文件復(fù)制到原本的 /usr/local/nginx/sbin/nginx cp /root/nginx-1.10.1/objs/nginx /usr/local/nginx/sbin/
./nginx -s reload ./nginx -V
文件目錄:/usr/local/nginx/conf
# 在文件中添加新的 location location /nginx_status { stub_status; } # 解釋說(shuō)明: nginx_status 這是自定義命名的,訪問(wèn)的時(shí)候添加這個(gè)字段訪問(wèn) stub_status; 這個(gè)是固定參數(shù)
http://192.168.169.131/nginx_status # 訪問(wèn)內(nèi)容結(jié)果如下圖
# 解釋說(shuō)明: 1)Active connections-活躍連接數(shù) The current number of active client connections including Waiting connections. (2)accepts-已接受的客戶端連接總數(shù) The total number of accepted client connections. (3)handled-已處理的連接總數(shù) The total number of handled connections. Generally, the parameter value is the same as acceptsunless some resource limits have been reached (for example, the worker_connections limit). (4)requests-客戶端連接總數(shù) The total number of client requests. (5)Reading-讀取請(qǐng)求頭的當(dāng)前連接數(shù) The current number of connections where nginx is reading the request header. (6)Writing-將響應(yīng)寫(xiě)回客戶端的當(dāng)前連接數(shù) The current number of connections where nginx is writing the response back to the client. (7)Waiting-等待請(qǐng)求的當(dāng)前空閑客戶端連接數(shù) The current number of idle client connections waiting for a request.
“nginx如何添加http_stub_status_module模塊”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注億速云網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。