Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Implementation method of Nginx configuration to detect the status of Service

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Check if the check status module is installed

[root@localhost] # nginx-Vnginx version: nginx/1.12.2built by gcc 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) configure arguments:-- prefix=/usr/local/nginx-- with-http_sub_module

two。 If not installed, recompile the installation

Status check module;-- with-http_stub_status_module

[root@localhost ~] # cd / usr/local/src/nginx-1.12.2/ [root@localhost ~] #. / configure-- prefix=/usr/local/nginx-- with-http_stub_status_ module [root @ localhost ~] # make & & make install

3. Edit the configuration file for nginx

[root@localhost ~] # vim / usr/local/nginx/conf/nginx.confserver {listen 80; server_name localhost; # access_log logs/host.access.log main; location / nginx_status {stub_status on; access_log off; # allow 127.0.1; # # filter visitors to this page # deny all }} [root@localhost ~] # nginx-tnginx: the configuration file / usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file / usr/local/nginx/conf/nginx.conf test is successful [root@localhost ~] # nginx-s reload

4. Test syntax

[root@localhost ~] # curl http://192.168.10.110:80/nginx_statusActive connections: 1server accepts handled requests 1 1 1Reading: 0 Writing: 1 Waiting: 0

5. Detailed explanation of output content

First line Active connections: 1-number of active connections, including waiting for clients 0 second line server accepts handled requests-A total of 1 connection was processed, 1 handshake was successfully created, a total of 1 request was processed on the third line Reading-number of connections read from the client, Writing-number of response data to the client Waiting-when keep-alive is enabled, this value equals active-(reading+writing), which means that Nginx has finished processing the resident connection waiting for the next request instruction.

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report