Help Center/ Application Operations Management/ FAQs (2.0)/ Collection Management/ How Do I Enable the Nginx stub_status Module?
Updated on 2025-08-29 GMT+08:00
How Do I Enable the Nginx stub_status Module?
Nginx Prometheus Exporter monitors the Nginx service using the stub_status module. Ensure that this module is enabled. Perform the following operations:
- Log in to the node where the Nginx service is deployed and run the following command (generally in the /usr/local/nginx/sbin/nginx directory) as the root user to check whether the stub_status module is enabled:
nginx -V 2>&1 | grep -o with-http_stub_status_module
- If with-http_stub_status_module is returned, the stub_status module is enabled.
- If no result is returned, enable the stub_status module by setting --with-http_stub_status_module in the configuration file. Example:
./configure \ ## Add the --with-http_stub_status_module parameter. --with-http_stub_status_module make sudo make install
- After the stub_status module is enabled, add the following content to the nginx.conf file (which is generally in the /usr/local/nginx/conf directory): Example:
- Open the nginx.conf file using the vi editor:
vi /usr/local/nginx/conf/nginx.conf
- Press i to enter the editing mode and add the following configuration information:
server { listen 8080; # Listening port. Set this parameter based on service requirements. listen [::]:8080; # IPv6 listening port. Set this parameter based on service requirements. server_name localhost; # Set this parameter based on service requirements. location = /stub_status { # Path. Set this parameter based on service requirements. stub_status on; access_log off; allow 127.0.0.1; } } - Press Esc and enter :wq to save the settings and exit.
- Open the nginx.conf file using the vi editor:
- Restart the Nginx service.
Parent topic: Collection Management
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.