[fly] nginx use stub_status to view the moon, connections, auth_basic to restric

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Nginx configured, now want to have a look the nginx link, how to do?

 

This simple, nginx HttpStubStatusModuleChs

See:

 

1 rapid configuration

Only need to join the stub_status on in the location configuration can be below;

 

 

    location /feilong-nginx-status {

        stub_status on;

     }

 

Use the feilong-nginx -manager v2.0 under heavy load the configuration file

 

The visit next have a look

 



  

 

The following information display

 

Active connections: 7
server accepts handled requests
 73 73 348
Reading: 1 Writing: 1 Waiting: 5

 

Each of the parameters. :

 

 

Active connections

The number of active connections to the back-end initiated.

Server accepts handled

requests

Nginx have 73 connections,

73 handshake was created successfully (without fail proof),

A total of 348 request processing.

Reading

Nginx read Header information of the client.

Writing

The number of Nginx Header information is returned to the client.

Waiting

Open the case of keep-alive, this value is equal to active – (reading + writing),

Which means that the Nginx has finished processing, waiting for the next request command resident connection.


 

2 security

 

This address must not casually by others to access, lock, lock. See Synonyms at Tomcat

 

2.1  auth basic

 

A relatively simple configuration, nginx HttpAuthBasicModule module, only just in place, plus auth_basic and auth_basic_user_file two parameters

 

  location /feilong-nginx-status {

        stub_status on;

        auth_basic "feilong nginx status";

        auth_basic_user_file htpasswd;

     }

The auth_basic used to display the user input form that basic

Which of the following auth_basic_user_file little bit complicated

 

2.1.1 if you installed on the server Apache

Can use its own tools to generate user name password

htpasswd -c /etc/nginx/htpasswd.users admin

 

If 2.1.2 is not Apache (who also with nginx, a Apache?)

  See also: How do I generate an htpasswd file without having Apache tools installed?

 

If 2.1.3 like Xin brother windows using the nginx test.

You can, and nginx.conf are the same files, create a htpasswd file

The inside of the username and password are as follows:

 

 



 

 

 

Hey, you might be found.

 

Windows this file, the password can be clear, can also be encrypted ciphertext

 

There is nothing more to say plaintext, ciphertext, can be generated online artifact used to generate making

 




 
 
 

 

 

In this way, we can access the ningx_status path needs a password

 



 

If there is no auth verification, will prompt 401 Authorization Required

 



 

 

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Austin at January 12, 2014 - 4:57 PM