Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | Yes |
Requirements | HttpStubStatusModule |
Time | 5m |
Make sure HttpStubStatusModule compiled
Type the following command to verify that HttpStubStatusModule is compiled and available to you:
nginx -V | grep --color -o http_stub_status
Enable Nginx status page on Linux/Unix
Edit nginx.conf, enter:
# vi nginx.conf
Update your server { ..... } block/context as follows (see how to deny access to IP address on nginx):
location /nginx_status { # Turn on nginx stats stub_status on; # I do not need logs for stats access_log off; # Security: Only allow access from 192.168.1.100 IP # allow 192.168.1.100; # Send rest of the world to /dev/null # deny all; }
Feel free to replace 192.168.1.100 with your actual IP address. This is a security feature as you do not want to show your status to the whole world.
Restart / reload nginx server
Type the following command to reload nginx:
# service nginx reload
OR
# nginx -s reload
How do I view nginx status page?
Fire a browser and type the url:
example.com/nginx_status
1.2.3.4/nginx_status
www.cyberciti.biz/nginx_status
Sample outputs:
🐧 6 comments so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Hello,
First, I wanna ask about “server load time”. Can you tell me how to configure it on nginx?
Thanks b4
What do you mean with “server load time”? That is going to depend on a lot of things, mainly your application, database access, etc.
If you want to test the load time of your site you could use site like webpagetest.org
I mean how to see our server total time (in second or ms) for each client request on our nginx server because from your tutorial only show :
1. How many connection are on Nginx server
2. How many connection are waiting,reading,writing
3. total accept request on server
Does Nginx have that setting that can see “server total time load”??
Thank b4 for answering my question.
*Note : I want to test my Nginx Server offline for my project..Sorry I’m Newbie
nginx -V – output info to stderr, so
nginx -V | grep –color -o http_stub_status
should be replaced with
nginx -V 2>&1 | grep –color -o http_stub_status
Hi
What if nginx instance have many server blocks. Does it shows for cumulative servers or just for any particular server?
Thanks
Vivek
It only shows current server.