HowTo: Enable Nginx Status Page

To enable the Nginx status page, you need to add a location block to your Nginx configuration file that will return information about the status of Nginx.

Here’s an example of how you can enable the Nginx status page:

  1. Open the Nginx configuration file in your preferred text editor:
sudo nano /etc/nginx/nginx.conf
  1. Add the following location block to the Nginx configuration file:
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
  1. Save the changes to the Nginx configuration file and close the text editor.
  2. Test the Nginx configuration for syntax errors:
sudo nginx -t
  1. If the test returns no errors, reload the Nginx configuration:
sudo systemctl reload nginx
  1. Verify that the Nginx status page is working by accessing it in a web browser. The URL to access the Nginx status page is http://your-server-ip/nginx_status.

This will enable the Nginx status page, which provides information about the current status of Nginx, including the number of active connections, the number of requests processed, and the amount of traffic processed. The status page is useful for monitoring the performance and health of your Nginx server.

Leave a Comment