nginx?添加http_stub_status_module模塊
1. stub_status 作用說明
編譯選項 | 作用 |
---|---|
–with-http_stub_status_module | Nginx的客戶端狀態(tài) |
2.查看現(xiàn)有 nginx 編譯參數(shù)
./nginx -V # 如果沒有我們需要的模塊,例如本次試驗添加的 –with-http_stub_status_module ,那么則需要重新編譯安裝一下
3.使用參數(shù)重新配置configure,在原有基礎上添加上 --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
4.將原來的 nginx 文件備份
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
5. 編譯
make # 這里是需要 make 編譯,不用 make install
6. 替換nginx二進制文件
# 找到 nginx 安裝包目錄 /root/nginx-1.10.1/objs ,將 nginx 文件復制到原本的 /usr/local/nginx/sbin/nginx cp /root/nginx-1.10.1/objs/nginx /usr/local/nginx/sbin/
7.重新啟動nginx,查看編譯參數(shù)
./nginx -s reload ./nginx -V
8. 參考官網(wǎng)
地址:https://nginx.org/libxslt/en/docs/http/ngx_http_stub_status_module.html
8.1 修改配置文件
文件目錄:/usr/local/nginx/conf
# 在文件中添加新的 location location /nginx_status { stub_status; } # 解釋說明: nginx_status 這是自定義命名的,訪問的時候添加這個字段訪問 stub_status; 這個是固定參數(shù)
8.2 瀏覽器訪問
http://192.168.169.131/nginx_status # 訪問內(nèi)容結果如下圖
# 解釋說明: 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-讀取請求頭的當前連接數(shù) The current number of connections where nginx is reading the request header. (6)Writing-將響應寫回客戶端的當前連接數(shù) The current number of connections where nginx is writing the response back to the client. (7)Waiting-等待請求的當前空閑客戶端連接數(shù) The current number of idle client connections waiting for a request.
參考官網(wǎng)地址:https://nginx.org/libxslt/en/docs/http/ngx_http_stub_status_module.html
到此這篇關于nginx 添加http_stub_status_module模塊的文章就介紹到這了,更多相關nginx 添加http_stub_status_module內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
windows系統(tǒng)下關閉Nignx的多種方式總結
這篇文章主要給大家總結介紹了windows系統(tǒng)下關閉Nignx的多種方式, 在Windows中啟動Nginx是簡單的,但有許多小伙伴不會關閉,這里給大家介紹下,需要的朋友可以參考下2023-08-08Nginx報錯host not found in upstream的解決辦法
本文主要介紹了Nginx報錯host not found in upstream的解決辦法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2023-08-08Windows環(huán)境下Nginx?服務器?SSL?證書安裝部署操作過程
這篇文章主要介紹了Windows環(huán)境下Nginx?服務器?SSL?證書安裝部署,指導您如何在Windows Nginx 服務器中安裝 SSL 證書,本文給大家講解的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2022-10-10Nginx通過用戶IP獲取所在國家及地理位置的實現(xiàn)方法
Nginx是一款高性能、輕量級的Web服務器和反向代理服務器,今天講解Nginx十分常用的功能之一,通過IP獲取用戶所在的國家,一般廣泛應用在各類需要定位的網(wǎng)站上面,來定位用戶首次訪問的國家,通過IP解析庫GeoLite2-Country來實現(xiàn)功能,需要的朋友可以參考下2023-10-10Nginx服務器作反向代理實現(xiàn)內(nèi)部局域網(wǎng)的url轉(zhuǎn)發(fā)配置
這篇文章主要介紹了Nginx服務器作反向代理實現(xiàn)內(nèi)部局域網(wǎng)的url轉(zhuǎn)發(fā)實例,文中提到需要注意proxy_read_timeout參數(shù)的相關調(diào)整,需要的朋友可以參考下2016-01-01