>  기사  >  운영 및 유지보수  >  nnix_http_stub_status_module

nnix_http_stub_status_module

巴扎黑
巴扎黑원래의
2017-06-23 14:13:041573검색

1.ngx_http_stub_status_module은 Nginx 상태 정보를 제공할 수 있는 Nginx에 내장된 HTTP 모듈입니다. 기본적으로 이 모듈은 컴파일되지 않으므로 Nginx--with-http_stub_status_module--with-http_stub_status_module

2.首先检查nginx是否安装ngx_http_stub_status_module模块

如果没有安装,需要重新编译。

# nginx  -V | grep http_stub   

ngx_http_stub_status_module (static)

# nginx   -v

Tengine version: Tengine/2.1.1 (nginx/1.6.2)

 

3,首先在nginxserver段配置对应的信息

server {

    listen  80;

    server_name  xxx;

    location /<strong>ngx_status   </strong>自定义模块名称

    {

        stub_status on; 开启状态访问

        access_log off;

    #allow all;   可以设置需要那些主机访问

    #deny all;

    }

}

4,重新加载nginx,访问测试

# service nginx reload

 

curl 127.0.0.1:80/<strong>ngx_status</strong>

Active connections: 135  

server accepts handled requests request_time

 13711907 25715823 5175039843

Reading: 0 Writing: 12 Waiting: 123

<strong>说明:</strong>

<strong>Active connections: 135</strong>  #//正在活跃的连接数

server accepts handled requests  

13711907 25715823 5175039843          #处理了13711907次连接,创建25715823次握手,共5175039843请求。<br>

<strong>Reading: 0 Writing: 1 Waiting: 1  </strong>        # Reading:读取客户端header数,Writing:返回客户端header数,Waiting:请求完成,等待下一次连接。

🎜컴파일 시 이 모듈을 로드하도록 지정해야 합니다.2. <code>nginx설치 여부ngx_http_stub_status_module모듈🎜🎜🎜🎜설치되지 않은 경우 필요 재컴파일됩니다. 🎜🎜🎜🎜# nginx -V | grep http_stub 🎜🎜🎜🎜ngx_http_stub_status_module(정적)🎜🎜🎜🎜# nginx -v code>🎜🎜🎜🎜<code>Tengine 버전: Tengine/2.1.1(nginx/1.6.2)🎜🎜🎜🎜 🎜🎜🎜🎜3, 첫 번째 nginxserver 섹션 구성 해당 정보🎜🎜🎜🎜server {🎜🎜🎜🎜 Listen 80;🎜🎜🎜🎜 server_name xxx;🎜🎜🎜🎜 위치 /<strong>ngx_status </strong>사용자 정의 모듈 이름🎜 🎜 🎜🎜 모두 허용; 액세스가 필요한 호스트를 설정할 수 있습니다🎜🎜🎜🎜  #deny all;🎜🎜🎜🎜 }🎜🎜🎜 🎜<code>}🎜🎜🎜🎜4, 다시 로드nginx,액세스 테스트🎜🎜🎜 🎜# 서비스 nginx reload🎜🎜🎜🎜🎜🎜curl 127.0.0.1:80/<strong>ngx_status</strong>🎜🎜🎜🎜활성 연결: 135 🎜🎜🎜🎜서버가 요청 처리된 요청을 허용_시간🎜🎜🎜🎜 13711907 25715823 5175039843🎜🎜🎜🎜읽기: 0 쓰기: 12 대기: 123 🎜🎜🎜🎜<strong>설명: </strong>🎜🎜🎜🎜<strong>활성 연결: 135</strong> #// 활성 연결 수🎜🎜🎜🎜서버가 처리된 요청을 수락함 🎜🎜🎜🎜13711907 25715823 5175039843 /code>#처리된 13711907 연결 및 생성된 25715823 code ><code>핸드셰이크, 총5175039843요청. <br>🎜🎜🎜🎜<strong>읽기: 0 쓰기: 1 대기: 1 </strong> # 읽기: code> code>클라이언트 읽기헤더번호, 쓰기:클라이언트로 돌아가기headerNumber, Waiting:요청이 완료되었으며 다음 연결을 기다리고 있습니다. 🎜🎜
 <br>

위 내용은 nnix_http_stub_status_module의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.